generated from shuding/nextra-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
861 additions
and
18,511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {createTheme, MantineProvider} from "@mantine/core"; | ||
import {useTheme} from "next-themes"; | ||
import {useMemo} from "react"; | ||
|
||
const mantineThemeOverride = createTheme({ | ||
autoContrast: true | ||
}); | ||
|
||
export const MantineWrapper = ({ children }) => { | ||
const { theme } = useTheme() | ||
|
||
const mantineTheme = useMemo(() => { | ||
switch (theme) { | ||
case "dark": | ||
return "dark"; | ||
case "light": | ||
return "light"; | ||
default: | ||
return undefined; | ||
|
||
} | ||
}, [theme]); | ||
|
||
return ( | ||
<MantineProvider theme={mantineThemeOverride} forceColorScheme={mantineTheme}> | ||
{children} | ||
</MantineProvider> | ||
) | ||
} |
Oops, something went wrong.