diff options
Diffstat (limited to 'src/containers')
| -rw-r--r-- | src/containers/Page/Page.tsx | 3 | ||||
| -rw-r--r-- | src/containers/Profile/MoreMenu.tsx | 72 | ||||
| -rw-r--r-- | src/containers/Profile/ProfileInfo.tsx | 2 | 
3 files changed, 2 insertions, 75 deletions
diff --git a/src/containers/Page/Page.tsx b/src/containers/Page/Page.tsx index f6a0aa5..d1171e6 100644 --- a/src/containers/Page/Page.tsx +++ b/src/containers/Page/Page.tsx @@ -16,7 +16,7 @@ const Notifications = React.lazy(() => import('../Notifications/Notifications'))  const useStyles = makeStyles(theme => ({    root: {      [theme.breakpoints.down('sm')]: { -      margin: theme.spacing(15, 0, 12, 0) +      margin: theme.spacing(12, 0, 12, 0)      },      [theme.breakpoints.up('md')]: {        margin: theme.spacing(15, 5, 8, 5) @@ -32,6 +32,7 @@ const Page: React.FC = () => {    return (      <SnackbarProvider +      preventDuplicate        maxSnack={isMobile ? 1 : 3}        anchorOrigin={{          vertical: isMobile ? 'top' : 'bottom', diff --git a/src/containers/Profile/MoreMenu.tsx b/src/containers/Profile/MoreMenu.tsx deleted file mode 100644 index 1f41879..0000000 --- a/src/containers/Profile/MoreMenu.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import React from 'react'; -import { useHistory } from 'react-router-dom'; -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'; - -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<HTMLButtonElement | null>(null); -  const { logout } = useAuth(); -  const history = useHistory(); - -  const open = Boolean(anchorEl); - -  const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => { -    setAnchorEl(event.currentTarget); -  }; - -  const handleLogout = () => { -    logout(); -    history.push('/login'); -  }; - -  const handleClose = () => { -    setAnchorEl(null); -  }; - -  return ( -    <div className={classes.moreMenu}> -      <div> -        <IconButton -          aria-label="more" -          aria-controls="long-menu" -          aria-haspopup="true" -          onClick={handleClick} -        > -          <MoreHorizIcon /> -        </IconButton> -        <Menu -          id="long-menu" -          anchorEl={anchorEl} -          keepMounted -          open={open} -          onClose={handleClose} -          PaperProps={{ -            style: { -              maxHeight: ITEM_HEIGHT * 4.5, -              width: '20ch' -            } -          }} -        > -          <MenuItem onClick={handleLogout}>Log out</MenuItem> -        </Menu> -      </div> -    </div> -  ); -}; - -export default MoreMenu; diff --git a/src/containers/Profile/ProfileInfo.tsx b/src/containers/Profile/ProfileInfo.tsx index a01c222..87af99d 100644 --- a/src/containers/Profile/ProfileInfo.tsx +++ b/src/containers/Profile/ProfileInfo.tsx @@ -5,7 +5,6 @@ import { User } from 'which-types';  import CameraAltIcon from '@material-ui/icons/CameraAlt';  import VerifiedIcon from '@material-ui/icons/CheckCircleOutline';  import Skeleton from '@material-ui/lab/Skeleton'; -import MoreMenu from './MoreMenu';  import Highlight from './Highlight';  import UploadImage from '../../components/UploadImage/UploadImage';  import Avatar from '../../components/Avatar/Avatar'; @@ -110,7 +109,6 @@ const ProfileInfo: React.FC<PropTypes> = ({            : userInfo?._id === user?._id              ? (                <div> -                <MoreMenu />                  <div className={classes.avatarContainer}>                    <Badge                      overlap="circle"  |