diff --git a/src/components/Theme/ThemeContext.tsx b/src/components/Theme/ThemeContext.tsx index 8ce2c6a..3044045 100644 --- a/src/components/Theme/ThemeContext.tsx +++ b/src/components/Theme/ThemeContext.tsx @@ -41,21 +41,16 @@ export const ThemeProvider = ({ children }) => { userThemes.find((theme) => theme.id === currentThemeId) || defaultTheme; const muiTheme = useMemo(() => { - if (themeMode === 'light') { - return createTheme({ - ...lightThemeOptions, - palette: { - ...currentTheme.light, - }, - }); - } else { - return createTheme({ - ...lightThemeOptions, - palette: { - ...currentTheme.dark, - }, - }); - } + const baseThemeOptions = + themeMode === 'light' ? lightThemeOptions : darkThemeOptions; + + const palette = + themeMode === 'light' ? currentTheme.light : currentTheme.dark; + + return createTheme({ + ...baseThemeOptions, + palette, + }); }, [themeMode, currentTheme]); const saveSettings = (