From 20deef5f5ad93516eaaabe580c4ca5f3f568ee35 Mon Sep 17 00:00:00 2001 From: M M Date: Fri, 24 May 2024 18:02:58 -0700 Subject: [PATCH] Refactored the Navbar with an avatar and a full bar to better match the sought after design. --- Client/src/Components/NavBar/index.jsx | 160 +++++++++++++++++++------ 1 file changed, 125 insertions(+), 35 deletions(-) diff --git a/Client/src/Components/NavBar/index.jsx b/Client/src/Components/NavBar/index.jsx index c9f08a292..fa1a8bc15 100644 --- a/Client/src/Components/NavBar/index.jsx +++ b/Client/src/Components/NavBar/index.jsx @@ -1,48 +1,138 @@ import { useState } from 'react'; -import './index.css'; -import Button from '@mui/material/Button'; +import AppBar from '@mui/material/AppBar'; +import Box from '@mui/material/Box'; +import Toolbar from '@mui/material/Toolbar'; +import IconButton from '@mui/material/IconButton'; +import Typography from '@mui/material/Typography'; import Menu from '@mui/material/Menu'; +import MenuIcon from '@mui/icons-material/Menu'; +import Container from '@mui/material/Container'; +import Avatar from '@mui/material/Avatar'; +import Tooltip from '@mui/material/Tooltip'; import MenuItem from '@mui/material/MenuItem'; +import { useTheme } from '@mui/material/styles'; -const NavBar = () => { - const [anchorEl, setAnchorEl] = useState(null); - const open = Boolean(anchorEl); +const settings = ['Profile', 'Team', 'Invite Colleagues', 'Logout']; - const handleClick = (event) => { - setAnchorEl(event.currentTarget); - }; +/** + * NavBar component + * + * A responsive navigation bar component with a user menu. + * + * @component + * @example + * return ( + * + * ) + */ +function NavBar() { + const theme = useTheme(); + const [anchorElUser, setAnchorElUser] = useState(null); - const handleClose = () => { - setAnchorEl(null); - }; + /** + * Handles opening the user menu. + * + * @param {React.MouseEvent} event - The event triggered by clicking the user menu button. + */ + const handleOpenUserMenu = (event) => { + setAnchorElUser(event.currentTarget); + }; - return ( -
- + + + + + + UPTIME GENIE + + + + + + + + + + - Profile - Team - Invite Colleagues - Log Out + {settings.map((setting) => ( + + {setting} + + ))} -
- ); -}; + + + + + ); +} export default NavBar;