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;
|
userThemes.find((theme) => theme.id === currentThemeId) || defaultTheme;
|
||||||
|
|
||||||
const muiTheme = useMemo(() => {
|
const muiTheme = useMemo(() => {
|
||||||
if (themeMode === 'light') {
|
const baseThemeOptions =
|
||||||
return createTheme({
|
themeMode === 'light' ? lightThemeOptions : darkThemeOptions;
|
||||||
...lightThemeOptions,
|
|
||||||
palette: {
|
const palette =
|
||||||
...currentTheme.light,
|
themeMode === 'light' ? currentTheme.light : currentTheme.dark;
|
||||||
},
|
|
||||||
});
|
return createTheme({
|
||||||
} else {
|
...baseThemeOptions,
|
||||||
return createTheme({
|
palette,
|
||||||
...lightThemeOptions,
|
});
|
||||||
palette: {
|
|
||||||
...currentTheme.dark,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [themeMode, currentTheme]);
|
}, [themeMode, currentTheme]);
|
||||||
|
|
||||||
const saveSettings = (
|
const saveSettings = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user