fix bug window
This commit is contained in:
+3
-2
@@ -1,13 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { ThemeProvider } from "next-themes";
|
import { ThemeProvider } from "next-themes";
|
||||||
|
import { usePathname } from "next/navigation";
|
||||||
|
|
||||||
export function Providers({ children }) {
|
export function Providers({ children }) {
|
||||||
const isDark = window.location.pathname.includes("/panel");
|
const router = usePathname();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
attribute={isDark ? "class" : "data-"}
|
attribute={router.includes("/panel") ? "class" : "data-"}
|
||||||
defaultTheme="system"
|
defaultTheme="system"
|
||||||
enableSystem
|
enableSystem
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user