diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 25f041e..8188b8d 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -27,6 +27,15 @@ const ALLOWED_TABS: Record = { export const App: React.FC = () => { const { user, activeRole, setActiveRole, isAuthenticated, isLoading, logout } = useAuth(); const [activeTab, setActiveTab] = useState('create'); + const [theme, setTheme] = useState<'dark' | 'light'>(() => { + const savedTheme = window.localStorage.getItem('resolveiq-theme'); + return savedTheme === 'light' ? 'light' : 'dark'; + }); + + useEffect(() => { + document.documentElement.dataset.theme = theme; + window.localStorage.setItem('resolveiq-theme', theme); + }, [theme]); useEffect(() => { if (!ALLOWED_TABS[activeRole].includes(activeTab)) setActiveTab(DEFAULT_TAB[activeRole]); @@ -72,7 +81,15 @@ export const App: React.FC = () => { return (
- + setTheme(currentTheme => currentTheme === 'dark' ? 'light' : 'dark')} + onLogout={logout} + />
diff --git a/frontend/src/components/layout/Navbar.tsx b/frontend/src/components/layout/Navbar.tsx index 1d90418..a1d4cce 100644 --- a/frontend/src/components/layout/Navbar.tsx +++ b/frontend/src/components/layout/Navbar.tsx @@ -1,12 +1,14 @@ import React from 'react'; -import { Bell, ChevronDown, LogOut, Sparkles } from 'lucide-react'; +import { Bell, ChevronDown, LogOut, Moon, Sun } from 'lucide-react'; import { Role } from '../../types'; interface NavbarProps { currentRole: Role; availableRoles: Role[]; userName: string; + theme: 'dark' | 'light'; onRoleChange: (role: string) => void; + onThemeToggle: () => void; onLogout: () => Promise; } @@ -23,7 +25,9 @@ export const Navbar: React.FC = ({ currentRole, availableRoles, userName, + theme, onRoleChange, + onThemeToggle, onLogout, }) => { const initials = userName @@ -34,20 +38,15 @@ export const Navbar: React.FC = ({ .toUpperCase(); return ( -
-
+
+
-
- -
+
R
ResolveIQ - - Alpha -
- Support intelligence workspace + Support workspace
@@ -86,6 +85,16 @@ export const Navbar: React.FC = ({ + +
{initials || 'RI'} diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index e0ecb46..3246bf5 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -93,7 +93,7 @@ export const Sidebar: React.FC = ({ currentRole, activeTab, onSele key={item.id} onClick={() => onSelectTab(item.id)} aria-current={isActive ? 'page' : undefined} - className={`group relative flex items-center gap-3 rounded-btn text-sm transition-colors lg:w-full lg:px-3 lg:py-2.5 ${ + className={`group relative flex items-center gap-3 rounded-btn text-sm transition-colors lg:w-full lg:px-3 lg:py-2 ${ isActive ? 'bg-primary-soft text-primary' : 'text-muted hover:bg-surface-muted hover:text-DEFAULT' @@ -101,14 +101,13 @@ export const Sidebar: React.FC = ({ currentRole, activeTab, onSele > {item.label} - {isActive && } ); }); return ( <> -