Implemented the navbar dropdown section for the user.
This commit is contained in:
1 parent
564918c726
commit
f7b0ccc9cc
1 file changed
+45
-7
@@ -1,10 +1,48 @@
|
|||||||
import React from 'react'
|
import { useState } from 'react';
|
||||||
import './index.css'
|
import './index.css';
|
||||||
|
import Button from '@mui/material/Button';
|
||||||
|
import Menu from '@mui/material/Menu';
|
||||||
|
import MenuItem from '@mui/material/MenuItem';
|
||||||
|
|
||||||
const NavBar = () => {
|
const NavBar = () => {
|
||||||
return (
|
const [anchorEl, setAnchorEl] = useState(null);
|
||||||
<div>NavBar Component</div>
|
const open = Boolean(anchorEl);
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default NavBar
|
const handleClick = (event) => {
|
||||||
|
setAnchorEl(event.currentTarget);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
setAnchorEl(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Button
|
||||||
|
id="basic-button"
|
||||||
|
aria-controls={open ? 'basic-menu' : undefined}
|
||||||
|
aria-haspopup="true"
|
||||||
|
aria-expanded={open ? 'true' : undefined}
|
||||||
|
onClick={handleClick}
|
||||||
|
>
|
||||||
|
Jackie Dawn
|
||||||
|
</Button>
|
||||||
|
<Menu
|
||||||
|
id="basic-menu"
|
||||||
|
anchorEl={anchorEl}
|
||||||
|
open={open}
|
||||||
|
onClose={handleClose}
|
||||||
|
MenuListProps={{
|
||||||
|
'aria-labelledby': 'basic-button',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MenuItem onClick={handleClose}>Profile</MenuItem>
|
||||||
|
<MenuItem onClick={handleClose}>Team</MenuItem>
|
||||||
|
<MenuItem onClick={handleClose}>Invite Colleagues</MenuItem>
|
||||||
|
<MenuItem onClick={handleClose}>Log Out</MenuItem>
|
||||||
|
</Menu>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NavBar;
|
||||||
Reference in new issue
Block a user