alpha
Login
or
Join now
nandi.uk
/
semble
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
feat: theme switch hotkey
author
Pouria Delfanazari
date
2 months ago
(May 20, 2026, 5:32 PM -0700)
commit
20ea1beb
20ea1bebf9e591736c94a053bee2674bd420540e
parent
e1ca6a3c
e1ca6a3c05bf400f6195fbb0dd7235f2b7e6cc11
+20
-1
1 changed file
Expand all
Collapse all
Unified
Split
src
webapp
providers
mantine.tsx
+20
-1
src/webapp/providers/mantine.tsx
View file
Reviewed
···
7
7
import { theme } from '@/styles/theme';
8
8
import {
9
9
MantineProvider as BaseProvider,
10
10
+
useMantineColorScheme,
10
11
v8CssVariablesResolver,
11
12
} from '@mantine/core';
12
13
import {
13
14
CodeHighlightAdapterProvider,
14
15
createShikiAdapter,
15
16
} from '@mantine/code-highlight';
16
16
-
17
17
+
import { useHotkeys } from '@mantine/hooks';
17
18
import { Notifications } from '@mantine/notifications';
18
19
19
20
interface Props {
···
33
34
34
35
const shikiAdapter = createShikiAdapter(loadShiki);
35
36
37
37
+
const schemes = ['light', 'dark', 'auto'] as const;
38
38
+
type ColorScheme = (typeof schemes)[number];
39
39
+
40
40
+
function ThemeHotkey() {
41
41
+
const { colorScheme, setColorScheme } = useMantineColorScheme();
42
42
+
useHotkeys([
43
43
+
[
44
44
+
'ctrl+shift+T',
45
45
+
() => {
46
46
+
const idx = schemes.indexOf(colorScheme as ColorScheme);
47
47
+
setColorScheme(schemes[(idx + 1) % schemes.length]);
48
48
+
},
49
49
+
],
50
50
+
]);
51
51
+
return null;
52
52
+
}
53
53
+
36
54
export default function MantineProvider(props: Props) {
37
55
return (
38
56
<BaseProvider
···
41
59
cssVariablesResolver={v8CssVariablesResolver}
42
60
>
43
61
<CodeHighlightAdapterProvider adapter={shikiAdapter}>
62
62
+
<ThemeHotkey />
44
63
<Notifications
45
64
position="bottom-right"
46
65
pauseResetOnHover="notification"