Standardized

This commit is contained in:
Sean Edmunds
2025-01-30 17:00:26 -06:00
parent cfdb1b2b4f
commit 9430db990b
20 changed files with 89 additions and 80 deletions

View File

@@ -28,16 +28,12 @@ function App() {
endpoint: 'api/themes',
});
const { theme, setTheme, themeName, handleThemeChange } = useCommonHooks();
useEffect(() => {
if (allThemes && themeName) {
if (themeName !== 'random') {
const temp = allThemes.find((t: any) => t.name === themeName);
setTheme(temp);
} else {
handleThemeChange(allThemes, false);
}
}
}, [isAllThemesFetched, themeName]);
const overrides = createTheme({
white: theme?.backgroundColor,
fontFamily: '-apple-system,Jost,BlinkMacSystemFont,Helvetica Neue,Roboto,sans-serif',
});
const mantineTheme = mergeMantineTheme(DEFAULT_THEME, overrides);
const router = createBrowserRouter(
createRoutesFromElements(
<Route>
@@ -55,11 +51,18 @@ function App() {
</Route>,
),
);
const overrides = createTheme({
white: theme?.backgroundColor,
fontFamily: '-apple-system,Jost,BlinkMacSystemFont,Helvetica Neue,Roboto,sans-serif',
});
const mantineTheme = mergeMantineTheme(DEFAULT_THEME, overrides);
useEffect(() => {
if (allThemes && themeName) {
if (themeName !== 'random') {
const temp = allThemes.find((t: any) => t.name === themeName);
setTheme(temp);
} else {
handleThemeChange(allThemes, false);
}
}
}, [isAllThemesFetched, themeName]);
return (
<>
{theme && (