diff --git a/crop-x/src/app/layout.tsx b/crop-x/src/app/layout.tsx
index 49f6462..960291a 100644
--- a/crop-x/src/app/layout.tsx
+++ b/crop-x/src/app/layout.tsx
@@ -1,6 +1,7 @@
import {Navbar1} from "@/components/layouts/Navbar"
import {SideBarOld} from '@/components/layouts/SideBar/SideBarOld'
import '@/styles/globals.css'
+import { ThemeProvider } from 'next-themes'
const centralConfigData = {
navMain: [
@@ -138,16 +139,23 @@ export default function RootLayout({
children: React.ReactNode
}) {
return (
-
-
-
-
-
-
- {children}
-
+
+
+
+
-
+
)
diff --git a/crop-x/src/components/layouts/Navbar.tsx b/crop-x/src/components/layouts/Navbar.tsx
index e5a7076..993d135 100644
--- a/crop-x/src/components/layouts/Navbar.tsx
+++ b/crop-x/src/components/layouts/Navbar.tsx
@@ -4,6 +4,7 @@ import { Book, Menu, Sunset, Trees, Zap } from "lucide-react";
import { Tractor, Map, Clipboard, Package, Brain, Droplets, Settings } from 'lucide-react';
import { MessageBell } from './components/MessageBell';
import { UserProfile } from './components/UserProfile';
+import { ThemeToggle } from './ThemeToggle';
import { AuthProvider } from './components/auth/AuthContext';
import { useElementHeight } from '@/hooks/useElementHeight';
import { useViewHeight } from '@/hooks/useViewHeight';
@@ -197,6 +198,7 @@ const Navbar1 = () => {
+
@@ -241,6 +243,9 @@ const Navbar1 = () => {
+
+
+
diff --git a/crop-x/src/components/layouts/ThemeToggle.tsx b/crop-x/src/components/layouts/ThemeToggle.tsx
new file mode 100644
index 0000000..d84ab8a
--- /dev/null
+++ b/crop-x/src/components/layouts/ThemeToggle.tsx
@@ -0,0 +1,44 @@
+'use client';
+
+import * as React from 'react';
+import { Moon, Sun } from 'lucide-react';
+import { useTheme } from 'next-themes';
+
+import { Button } from '@/components/ui/button';
+
+export function ThemeToggle() {
+ const { theme, setTheme } = useTheme();
+ const [mounted, setMounted] = React.useState(false);
+
+ React.useEffect(() => {
+ setMounted(true);
+ }, []);
+
+ if (!mounted) {
+ return (
+
+ );
+ }
+
+ const isDark = theme === 'dark';
+
+ const toggleTheme = () => {
+ setTheme(isDark ? 'light' : 'dark');
+ };
+
+ return (
+
+ );
+}
\ No newline at end of file