Skip to content

Commit

Permalink
Changed method name
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Feb 20, 2020
1 parent 0860654 commit cdcf880
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const GuideThemeSelectorComponent = ({ context }) => {
options={EUI_THEMES}
value={context.theme}
onChange={e => {
context.toggleDark(e.target.value);
context.changeTheme(e.target.value);
}}
aria-label="Switch the theme"
/>
Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/components/with_theme/theme_context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { applyTheme } from '../../services';
const defaultState = {
theme: EUI_THEMES[0].value,
themeIsLoading: false,
toggleDark: (themeValue: EUI_THEME['value']) => {
changeTheme: (themeValue: EUI_THEME['value']) => {
applyTheme(themeValue);
},
};
Expand All @@ -31,7 +31,7 @@ export class ThemeProvider extends React.Component<object, State> {
};
}

toggleDark = (themeValue: EUI_THEME['value']) => {
changeTheme = (themeValue: EUI_THEME['value']) => {
this.setState({ theme: themeValue, themeIsLoading: true }, () => {
localStorage.setItem('theme', themeValue);
applyTheme(themeValue);
Expand All @@ -46,7 +46,7 @@ export class ThemeProvider extends React.Component<object, State> {
value={{
theme,
themeIsLoading,
toggleDark: this.toggleDark,
changeTheme: this.changeTheme,
}}>
{children}
</ThemeContext.Provider>
Expand Down

0 comments on commit cdcf880

Please sign in to comment.