This commit is contained in:
32
src/App.tsx
32
src/App.tsx
@@ -5,6 +5,7 @@ import {
|
||||
MantineProvider,
|
||||
mergeMantineTheme,
|
||||
} from '@mantine/core';
|
||||
import { useHotkeys } from '@mantine/hooks';
|
||||
import { Notifications } from '@mantine/notifications';
|
||||
import { Loading, MainLayout } from 'components';
|
||||
import { useCommonHooks, useQueryAPI } from 'hooks';
|
||||
@@ -61,6 +62,37 @@ function App() {
|
||||
autoContrast: true,
|
||||
});
|
||||
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(
|
||||
createRoutesFromElements(
|
||||
<Route>
|
||||
|
||||
Reference in New Issue
Block a user