-
Notifications
You must be signed in to change notification settings - Fork 52
/
index.js
37 lines (33 loc) · 953 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React, { Fragment, useState } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import IconButton from '@material-ui/core/IconButton';
import MenuIcon from '@material-ui/icons/Menu';
import Drawer from '@material-ui/core/Drawer';
import Content from 'components/layout/header/sidenav/content';
const useStyles = makeStyles(theme => ({
menuButton: {
marginRight: theme.spacing(2),
},
}));
export default function Sidenav() {
const classes = useStyles();
const [open, setOpen] = useState(false);
const onClose = () => setOpen(false);
const onOpen = () => setOpen(true);
return (
<Fragment>
<IconButton
edge="start"
className={classes.menuButton}
color="inherit"
aria-label="open drawer"
onClick={onOpen}
>
<MenuIcon />
</IconButton>
<Drawer open={open} onClose={onClose}>
<Content />
</Drawer>
</Fragment>
);
}