From 0ae79c52a96b507d914991e8914bb7cefa56f261 Mon Sep 17 00:00:00 2001 From: CTO Agent Date: Wed, 8 Jul 2026 15:00:03 +0530 Subject: [PATCH 1/2] YAS-259: add working dark mode button - HeaderBar: theme-aware light/dark styling + toggle button - Sidebar: theme-aware styling + dark mode toggle at bottom - AppLayout: sync Tailwind dark class and dark background for main content --- frontend/src/components/AppLayout.jsx | 6 ++- frontend/src/components/HeaderBar.jsx | 62 +++++++++++++++++++++++---- frontend/src/components/Sidebar.jsx | 18 +++++--- 3 files changed, 71 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/AppLayout.jsx b/frontend/src/components/AppLayout.jsx index 44bf849..3261529 100644 --- a/frontend/src/components/AppLayout.jsx +++ b/frontend/src/components/AppLayout.jsx @@ -22,8 +22,10 @@ const AppLayout = ({ children }) => { {/* Main content on the right, shifts when sidebar expands */} -
-
+
+
{children}
diff --git a/frontend/src/components/HeaderBar.jsx b/frontend/src/components/HeaderBar.jsx index cd9ea0f..7133fc6 100644 --- a/frontend/src/components/HeaderBar.jsx +++ b/frontend/src/components/HeaderBar.jsx @@ -1,22 +1,36 @@ import React from 'react'; import { NavLink } from 'react-router-dom'; -import { Settings, User } from 'lucide-react'; +import { Settings, User, Sun, Moon } from 'lucide-react'; import { useAuth } from '../contexts/AuthContext'; +import { useColorMode } from '../contexts/ThemeContext'; import logo from '../assets/logo.png'; const HeaderBar = () => { const { isAuthenticated, user } = useAuth(); + const { mode, toggleMode } = useColorMode(); + const isDark = mode === 'dark'; + return ( -
+
YBIT -

+

Yashwantrao Bhonsale Institute Of Technology

- {/* Right nav: Dashboard + Settings + Account/Login (large screens) */} + {/* Right nav: Dashboard + Settings + Theme toggle + Account/Login (large screens) */}