Theme provider

This commit is contained in:
2026-01-07 11:01:54 -06:00
parent f71931d4a7
commit a93e2aa863
3 changed files with 71 additions and 24 deletions

View File

@@ -1,9 +1,12 @@
import React, { useState, useEffect } from 'react';
import { useTheme } from 'next-themes';
import AdminSidebar from '../components/AdminSidebar';
const AdminLayout = ({ children }) => {
const [sidebarOpen, setSidebarOpen] = useState(true);
const [isMobile, setIsMobile] = useState(false);
const { theme } = useTheme();
const isDark = theme === 'dark';
// Initialize sidebar state from localStorage
useEffect(() => {
@@ -43,7 +46,7 @@ const AdminLayout = ({ children }) => {
};
return (
<div className="flex h-screen bg-white">
<div className={`flex h-screen bg-background ${isDark ? 'dark' : ''}`}>
{/* Sidebar */}
<AdminSidebar
isOpen={sidebarOpen}