diff --git a/public/alert.png b/public/alert.png new file mode 100644 index 0000000..b7e58ae Binary files /dev/null and b/public/alert.png differ diff --git a/public/refresh.png b/public/refresh.png new file mode 100644 index 0000000..6e449c4 Binary files /dev/null and b/public/refresh.png differ diff --git a/src/components/AppHeader.jsx b/src/components/AppHeader.jsx index 45e3f74..2e1e2ea 100644 --- a/src/components/AppHeader.jsx +++ b/src/components/AppHeader.jsx @@ -8,12 +8,13 @@ import { useNavigate } from 'react-router-dom'; export default function AppHeader({ zone = 'public', onSelectMenuItem }) { const bgColor = { - public: '#40120EFF', - restricted: '#40120EFF', - private: '#40120EFF', + public: 'white', + restricted: 'white', + private: 'white', }; const [drawerExpanded, setDrawerExpanded] = useState(true); + const [currentPage, setCurrentPage] = useState('Dashboard'); // track current page const { user, logout } = useAuth(); const isPrivate = zone === 'private'; @@ -22,6 +23,13 @@ export default function AppHeader({ zone = 'public', onSelectMenuItem }) { const navigate = useNavigate(); + const handleMenuSelect = (page) => { + setCurrentPage(page); // update page title + onSelectMenuItem?.(page); // still notify parent + // you can also navigate if you have routes: + // navigate(`/${page.toLowerCase().replace(/\s+/g, '-')}`); + }; + return ( - {/* Login button only visible for public zone */} - {isPublic && !user && ( - - navigate('/login')}> - - Login - - - - )} + {/* LEFT SIDE: Current Page */} + + {currentPage} + + {/* RIGHT SIDE: User Info */} {user && ( - - {user.name} + + {user.name} )} - {/* Rendering the Drawer */} + {/* Drawer (hidden off canvas, just keeps logic) */} setDrawerExpanded(false)} - onSelect={onSelectMenuItem} // pass handler from App + onSelect={handleMenuSelect} // patched />