From cecd572861cb379fc493729d0d25b49aea2a28ea Mon Sep 17 00:00:00 2001 From: Ehsan Date: Mon, 30 Sep 2024 14:15:26 +0330 Subject: [PATCH] enable dark mode just in panel page --- app/Providers.js | 8 ++++++- app/panel/(layout)/layout.js | 22 ++++++++++---------- components/dashboard/userAccount/Head.js | 2 +- components/layoutPanel/header/icons/Theme.js | 2 +- components/panel/dashboard/list/index.js | 2 +- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/app/Providers.js b/app/Providers.js index 61c2c84..da9955f 100644 --- a/app/Providers.js +++ b/app/Providers.js @@ -3,8 +3,14 @@ import { ThemeProvider } from "next-themes"; export function Providers({ children }) { + const isDark = window.location.pathname.includes("/panel"); + return ( - + {children} ); diff --git a/app/panel/(layout)/layout.js b/app/panel/(layout)/layout.js index d519c29..c4362db 100644 --- a/app/panel/(layout)/layout.js +++ b/app/panel/(layout)/layout.js @@ -31,17 +31,17 @@ function LayoutPanel({ children }) {
-

+

{user.name}{" "} عزیز! diff --git a/components/layoutPanel/header/icons/Theme.js b/components/layoutPanel/header/icons/Theme.js index aa600c4..d436b09 100644 --- a/components/layoutPanel/header/icons/Theme.js +++ b/components/layoutPanel/header/icons/Theme.js @@ -5,7 +5,7 @@ import { useState } from "react"; function Theme() { const [mounted, setMounted] = useState(false); - const { theme, setTheme, resolvedTheme } = useTheme(); + const { theme, setTheme } = useTheme(); useState(() => setMounted(true), []); diff --git a/components/panel/dashboard/list/index.js b/components/panel/dashboard/list/index.js index cd6d44a..0b0aa34 100644 --- a/components/panel/dashboard/list/index.js +++ b/components/panel/dashboard/list/index.js @@ -6,7 +6,7 @@ import ColTable from "../../ColTable"; function List({ data, loading }) { return (

-
+

لیست نوبت های پزشکان