enable dark mode just in panel page
This commit is contained in:
+7
-1
@@ -3,8 +3,14 @@
|
||||
import { ThemeProvider } from "next-themes";
|
||||
|
||||
export function Providers({ children }) {
|
||||
const isDark = window.location.pathname.includes("/panel");
|
||||
|
||||
return (
|
||||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
|
||||
<ThemeProvider
|
||||
attribute={isDark ? "class" : "data-"}
|
||||
defaultTheme="system"
|
||||
enableSystem
|
||||
>
|
||||
{children}
|
||||
</ThemeProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user