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