enable dark mode just in panel page

This commit is contained in:
Ehsan
2024-09-30 14:15:26 +03:30
parent a824f14800
commit cecd572861
5 changed files with 21 additions and 15 deletions
+7 -1
View File
@@ -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>
);