Sidebar.js
2.43 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import React from 'react';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/styles';
import { Divider, Drawer } from '@material-ui/core';
import DashboardIcon from '@material-ui/icons/Dashboard';
import PeopleIcon from '@material-ui/icons/People';
import ShoppingBasketIcon from '@material-ui/icons/ShoppingBasket';
import TextFieldsIcon from '@material-ui/icons/TextFields';
import ImageIcon from '@material-ui/icons/Image';
import AccountBoxIcon from '@material-ui/icons/AccountBox';
import SettingsIcon from '@material-ui/icons/Settings';
import LockOpenIcon from '@material-ui/icons/LockOpen';
import { Profile, SidebarNav, UpgradePlan } from './components';
const useStyles = makeStyles(theme => ({
drawer: {
width: 240,
[theme.breakpoints.up('lg')]: {
marginTop: 64,
height: 'calc(100% - 64px)'
}
},
root: {
backgroundColor: theme.palette.white,
display: 'flex',
flexDirection: 'column',
height: '100%',
padding: theme.spacing(2)
},
divider: {
margin: theme.spacing(2, 0)
},
nav: {
marginBottom: theme.spacing(2)
}
}));
const Sidebar = props => {
const { open, variant, onClose, className, ...rest } = props;
const classes = useStyles();
const pages = [
{
title: '내 드라이브',
href: '/my-drive',
icon: <DashboardIcon />
},
{
title: '공유함',
href: '/share',
icon: <PeopleIcon />
},
{
title: '최근 열어본 파일',
href: '/recent',
icon: <ShoppingBasketIcon />
},
{
title: '휴지통',
href: '/trash',
icon: <LockOpenIcon />
},
{
title: '계정',
href: '/account',
icon: <AccountBoxIcon />
},
{
title: '설정',
href: '/settings',
icon: <SettingsIcon />
}
];
return (
<Drawer
anchor="left"
classes={{ paper: classes.drawer }}
onClose={onClose}
open={open}
variant={variant}
>
<div
{...rest}
className={clsx(classes.root, className)}
>
<Profile />
<Divider className={classes.divider} />
<SidebarNav
className={classes.nav}
pages={pages}
/>
</div>
</Drawer>
);
};
Sidebar.propTypes = {
className: PropTypes.string,
onClose: PropTypes.func,
open: PropTypes.bool.isRequired,
variant: PropTypes.string.isRequired
};
export default Sidebar;