This commit is contained in:
32
src/App.tsx
32
src/App.tsx
@@ -5,6 +5,7 @@ import {
|
|||||||
MantineProvider,
|
MantineProvider,
|
||||||
mergeMantineTheme,
|
mergeMantineTheme,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
|
import { useHotkeys } from '@mantine/hooks';
|
||||||
import { Notifications } from '@mantine/notifications';
|
import { Notifications } from '@mantine/notifications';
|
||||||
import { Loading, MainLayout } from 'components';
|
import { Loading, MainLayout } from 'components';
|
||||||
import { useCommonHooks, useQueryAPI } from 'hooks';
|
import { useCommonHooks, useQueryAPI } from 'hooks';
|
||||||
@@ -61,6 +62,37 @@ function App() {
|
|||||||
autoContrast: true,
|
autoContrast: true,
|
||||||
});
|
});
|
||||||
const mantineTheme = mergeMantineTheme(DEFAULT_THEME, overrides);
|
const mantineTheme = mergeMantineTheme(DEFAULT_THEME, overrides);
|
||||||
|
useHotkeys([
|
||||||
|
[
|
||||||
|
'shift + t',
|
||||||
|
() => {
|
||||||
|
const themeList = JSON.parse(
|
||||||
|
themePlaylists?.find((t: ThemePlaylist) => t?.name === currentThemePlaylist)
|
||||||
|
?.themeList ?? '[]',
|
||||||
|
);
|
||||||
|
if (themeList.length > 0 && currentThemePlaylist !== 'Time of Day') {
|
||||||
|
const filteredThemes = allThemes.filter((t: Theme) => themeList.includes(t.id));
|
||||||
|
handleThemeChange(filteredThemes, false);
|
||||||
|
} else if (currentThemePlaylist === 'All') {
|
||||||
|
handleThemeChange(allThemes, true);
|
||||||
|
} else if (currentThemePlaylist === 'Backgrounds') {
|
||||||
|
handleThemeChange(
|
||||||
|
allThemes.filter(
|
||||||
|
(a: any) => !a.backgroundImage.toLowerCase().includes('none'),
|
||||||
|
),
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
} else if (currentThemePlaylist === 'No Backgrounds') {
|
||||||
|
handleThemeChange(
|
||||||
|
allThemes.filter((a: any) =>
|
||||||
|
a.backgroundImage.toLowerCase().includes('none'),
|
||||||
|
),
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
]);
|
||||||
const router = createBrowserRouter(
|
const router = createBrowserRouter(
|
||||||
createRoutesFromElements(
|
createRoutesFromElements(
|
||||||
<Route>
|
<Route>
|
||||||
|
|||||||
Reference in New Issue
Block a user