fix: fixed theme blinking on reload
This commit is contained in:
@ -25,7 +25,7 @@ export default function RootLayout({ children }: Props) {
|
|||||||
lang="ru"
|
lang="ru"
|
||||||
{...mantineHtmlProps}>
|
{...mantineHtmlProps}>
|
||||||
<head>
|
<head>
|
||||||
<ColorSchemeScript />
|
<ColorSchemeScript defaultColorScheme={"auto"} />
|
||||||
<link
|
<link
|
||||||
rel="shortcut icon"
|
rel="shortcut icon"
|
||||||
href="/favicon.svg"
|
href="/favicon.svg"
|
||||||
@ -43,7 +43,7 @@ export default function RootLayout({ children }: Props) {
|
|||||||
<body>
|
<body>
|
||||||
<MantineProvider
|
<MantineProvider
|
||||||
theme={theme}
|
theme={theme}
|
||||||
defaultColorScheme={"dark"}>
|
defaultColorScheme={"auto"}>
|
||||||
<Header />
|
<Header />
|
||||||
{children}
|
{children}
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import style from "./ActionToggle.module.css";
|
|||||||
|
|
||||||
export function ColorSchemeToggle() {
|
export function ColorSchemeToggle() {
|
||||||
const { setColorScheme } = useMantineColorScheme();
|
const { setColorScheme } = useMantineColorScheme();
|
||||||
const computedColorScheme = useComputedColorScheme("light", {
|
const computedColorScheme = useComputedColorScheme(undefined, {
|
||||||
getInitialValueInEffect: true,
|
getInitialValueInEffect: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user