mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-24 08:31:20 +00:00
Refactor theme selection
This commit is contained in:
parent
52f2ce5de0
commit
3ff3c4d69b
@ -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 = (
|
||||
|
Loading…
x
Reference in New Issue
Block a user