import React from 'react'; import IconButton from '@material-ui/core/IconButton'; import Menu from '@material-ui/core/Menu'; import MenuItem from '@material-ui/core/MenuItem'; import MoreHorizIcon from '@material-ui/icons/MoreHoriz'; import { makeStyles } from '@material-ui/core'; import { useAuth } from '../../hooks/useAuth'; import { useNavigate } from '../../hooks/useNavigate'; const ITEM_HEIGHT = 48; const useStyles = makeStyles({ moreMenu: { position: 'absolute', right: 10, zIndex: 100 } }); const MoreMenu: React.FC = () => { const classes = useStyles(); const [anchorEl, setAnchorEl] = React.useState(null); const { logout } = useAuth(); const { navigate } = useNavigate(); const open = Boolean(anchorEl); const handleClick = (event: React.MouseEvent) => { setAnchorEl(event.currentTarget); }; const handleLogout = () => { logout(); navigate('auth'); }; const handleClose = () => { setAnchorEl(null); }; return (
Log out
); }; export default MoreMenu;