Hotkey
All checks were successful
Deploy to production / build (push) Successful in 17s

This commit is contained in:
2026-07-14 20:48:31 -05:00
parent edeed6b674
commit 53c0c1b450

View File

@@ -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>