@@ -28,6 +28,7 @@ const themeContext = createContext<ThemeContextType>(null)
28
28
29
29
export const ThemeProvider = ( { children } : ThemeProviderProps ) => {
30
30
const [ showThemeSwitcherDialog , setShowThemeSwitcherDialog ] = useState < boolean > ( false )
31
+ const [ showSwitchThemeLocationTippy , setShowSwitchThemeLocationTippy ] = useState < boolean > ( false )
31
32
const [ themeConfig , setThemeConfig ] = useState < ThemeConfigType > ( getThemeConfigFromLocalStorage )
32
33
33
34
const handleThemePreferenceChange : ThemeContextType [ 'handleThemePreferenceChange' ] = ( updatedThemePreference ) => {
@@ -73,14 +74,20 @@ export const ThemeProvider = ({ children }: ThemeProviderProps) => {
73
74
setShowThemeSwitcherDialog ( isVisible )
74
75
}
75
76
77
+ const handleShowSwitchThemeLocationTippyChange = ( isVisible : boolean ) => {
78
+ setShowSwitchThemeLocationTippy ( isVisible )
79
+ }
80
+
76
81
const value = useMemo < ThemeContextType > (
77
82
( ) => ( {
78
83
...themeConfig ,
79
84
showThemeSwitcherDialog,
80
85
handleThemeSwitcherDialogVisibilityChange,
81
86
handleThemePreferenceChange,
87
+ showSwitchThemeLocationTippy,
88
+ handleShowSwitchThemeLocationTippyChange,
82
89
} ) ,
83
- [ themeConfig , showThemeSwitcherDialog ] ,
90
+ [ themeConfig , showThemeSwitcherDialog , showSwitchThemeLocationTippy ] ,
84
91
)
85
92
86
93
return < themeContext . Provider value = { value } > { children } </ themeContext . Provider >
0 commit comments