diff --git a/App.tsx b/App.tsx index 4a912e1..5420ba6 100644 --- a/App.tsx +++ b/App.tsx @@ -10,6 +10,7 @@ import { AuthProvider } from "./contexts/AuthContext"; import { NotificationsProvider } from "./contexts/NotificationsContext"; import { ChatProvider } from "./contexts/ChatContext"; import { PaymentProvider } from "./contexts/PaymentContext"; +import { ThemeProvider } from "./contexts/ThemeContext"; const SplashPage = lazy(() => import("./pages/SplashPage")); const LoginPage = lazy(() => import("./pages/LoginPage")); @@ -33,6 +34,7 @@ const RouteFallback: React.FC = () => ( const App: React.FC = () => { return ( + @@ -76,6 +78,7 @@ const App: React.FC = () => { + ); }; diff --git a/components/layout/DashboardLayout.tsx b/components/layout/DashboardLayout.tsx index 6d8fc41..adb8e9c 100644 --- a/components/layout/DashboardLayout.tsx +++ b/components/layout/DashboardLayout.tsx @@ -2,11 +2,12 @@ import React from 'react'; // FIX: Use namespace import for react-router-dom to address potential module resolution issues. import * as ReactRouterDOM from 'react-router-dom'; -import { Home, CreditCard, History, Bell, User, Zap, ChevronsUpDown, LogOut, MessageSquare, Wine, Download, X } from 'lucide-react'; +import { Home, CreditCard, History, Bell, User, Zap, ChevronsUpDown, LogOut, MessageSquare, Wine, Download, X, Settings } from 'lucide-react'; import { motion, AnimatePresence } from 'framer-motion'; import { useAuth } from '../../hooks/useAuth'; import { useNotifications } from '../../contexts/NotificationsContext'; import { useChat } from '../../contexts/ChatContext'; +import { useTheme } from '../../contexts/ThemeContext'; import ShinyText from '../common/ShinyText'; const navItems = [ @@ -19,12 +20,14 @@ const navItems = [ ]; const bottomNavItems = [ + { path: '/dashboard/settings', icon: Settings, label: 'Settings' }, { path: '/dashboard/profile', icon: User, label: 'Profile' } ]; const NavItem: React.FC<{ item: typeof navItems[0]; isMobile: boolean }> = ({ item, isMobile }) => { const { unreadCount: unreadNotificationsCount } = useNotifications(); const { unreadCount: unreadChatCount } = useChat(); + const { isDark } = useTheme(); const isNotificationsLink = item.label === 'Notifications'; const isChatLink = item.label === 'Chat'; const badgeCount = isNotificationsLink ? unreadNotificationsCount : (isChatLink ? unreadChatCount : 0); @@ -39,13 +42,15 @@ const NavItem: React.FC<{ item: typeof navItems[0]; isMobile: boolean }> = ({ it {({ isActive }) => ( {badgeCount > 0 && ( - + {badgeCount > 9 ? '9+' : badgeCount} )} @@ -73,8 +78,8 @@ const NavItem: React.FC<{ item: typeof navItems[0]; isMobile: boolean }> = ({ it to={item.path} className={({ isActive }) => `flex items-center px-3 py-2.5 rounded-md transition-colors duration-200 text-sm font-medium ${isActive - ? 'bg-zinc-800 text-white' - : 'text-gray-400 hover:text-white hover:bg-zinc-800/50' + ? (isDark ? 'bg-zinc-800 text-white' : 'bg-gray-200 text-gray-900') + : (isDark ? 'text-gray-400 hover:text-white hover:bg-zinc-800/50' : 'text-gray-500 hover:text-gray-900 hover:bg-gray-100') }` } > @@ -93,6 +98,7 @@ const NavItem: React.FC<{ item: typeof navItems[0]; isMobile: boolean }> = ({ it const DashboardLayout: React.FC = () => { const location = ReactRouterDOM.useLocation(); const { profile, logout } = useAuth(); + const { isDark } = useTheme(); const allNavItemsForMobile = [...navItems, ...bottomNavItems]; const [showDownloadBanner, setShowDownloadBanner] = React.useState(() => { // Check if banner was dismissed before @@ -101,30 +107,30 @@ const DashboardLayout: React.FC = () => { }); return ( - + {/* Sidebar for Desktop */} -