Skip to content

Commit

Permalink
[F][C][SideBar] add 'My Profile' menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Fibii committed Oct 27, 2020
1 parent 8376ba2 commit 7d1030f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/components/Header/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import List from '@material-ui/core/List'
import { Link } from 'react-router-dom'
import ListItem from '@material-ui/core/ListItem'
import HomeIcon from '@material-ui/icons/Home'
import AccountBoxIcon from '@material-ui/icons/AccountBox'
import ListItemText from '@material-ui/core/ListItemText'
import AddBoxIcon from '@material-ui/icons/AddBox'
import ExitToAppIcon from '@material-ui/icons/ExitToApp'
Expand Down Expand Up @@ -54,7 +55,7 @@ const useStyles = makeStyles((theme) => ({
}))

const Sidebar = ({ state, dispatch }) => {
const [, setUser] = useContext(UserContext)
const [user, setUser] = useContext(UserContext)
const { drawerIsOpen } = state
const classes = useStyles()
const theme = useTheme()
Expand Down Expand Up @@ -103,6 +104,14 @@ const Sidebar = ({ state, dispatch }) => {
</ListItem>
</Paper>
</Link>
<Link to={`/user/${user.id}`} className={classes.link} data-testid="newQuestion-button">
<Paper className={classes.itemPaper}>
<ListItem button key="myProfile">
<AccountBoxIcon className={classes.icons} />
<ListItemText primary="My Profile" />
</ListItem>
</Paper>
</Link>
<Paper onClick={() => handleLogout()} className={classes.itemPaper}>
<ListItem button key="logout" data-testid="logoutDrawer-button">
<ExitToAppIcon className={classes.icons} />
Expand Down

0 comments on commit 7d1030f

Please sign in to comment.