Skip to content

Commit

Permalink
fix: use default os colorscheme by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane committed Aug 29, 2023
1 parent fe05dc5 commit b970d8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/providers/Mantine.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ColorScheme, MantineProvider as Provider } from "@mantine/core";
import { useLocalStorage } from "@mantine/hooks";
import { useColorScheme, useLocalStorage } from "@mantine/hooks";

interface MantineProviderProps {
children: React.ReactNode;
Expand All @@ -8,14 +8,15 @@ interface MantineProviderProps {
export const MantineProvider: React.FC<MantineProviderProps> = ({
children,
}) => {
const osColorScheme = useColorScheme();
const [colorScheme] = useLocalStorage<ColorScheme>({
key: "mantine-color-scheme",
});

return (
<Provider
theme={{
colorScheme,
colorScheme: colorScheme ?? osColorScheme,
breakpoints: {
xs: "30em",
sm: "50em",
Expand Down

0 comments on commit b970d8f

Please sign in to comment.