handle default dark theme & install next-themes
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { ThemeProvider } from "next-themes";
|
||||
|
||||
export function Providers({ children }) {
|
||||
return (
|
||||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
|
||||
{children}
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
+5
-2
@@ -1,6 +1,7 @@
|
||||
import "./globals.css";
|
||||
import ThemeRegistry from "./component/ThemeRegistry";
|
||||
import "jalaali-react-date-picker/lib/styles/index.css";
|
||||
import { Providers } from "./Providers";
|
||||
|
||||
export const metadata = {
|
||||
title: "نوبت724",
|
||||
@@ -13,9 +14,11 @@ export const metadata = {
|
||||
|
||||
export default function RootLayout({ children }) {
|
||||
return (
|
||||
<html lang="fa" dir="rtl">
|
||||
<html lang="fa" dir="rtl" suppressHydrationWarning>
|
||||
<ThemeRegistry>
|
||||
<body className="bg-[#FAFAFA]">{children}</body>
|
||||
<body className="bg-[#FAFAFA]">
|
||||
<Providers>{children}</Providers>
|
||||
</body>
|
||||
</ThemeRegistry>
|
||||
</html>
|
||||
);
|
||||
|
||||
@@ -48,7 +48,7 @@ function LayoutPanel({ children }) {
|
||||
setActive={setActive}
|
||||
disableProfile={pathname.includes("dashboard")}
|
||||
/>
|
||||
<section className="my-[24px] opacity-element mx-[16px] bg-[#FAFAFA]">
|
||||
<section className="my-[24px] opacity-element mx-[16px] bg-[#FAFAFA] dark:bg-[#1F1D2B]">
|
||||
{children}
|
||||
</section>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user