bbgo_origin/apps/frontend/components/SideBar.js

104 lines
2.6 KiB
JavaScript
Raw Normal View History

2022-06-12 15:11:42 +00:00
import Drawer from '@mui/material/Drawer';
import Divider from '@mui/material/Divider';
import List from '@mui/material/List';
2022-06-11 00:57:54 +00:00
import Link from 'next/link';
2022-06-12 15:11:42 +00:00
import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import DashboardIcon from '@mui/icons-material/Dashboard';
2022-06-12 15:11:42 +00:00
import ListItemText from '@mui/material/ListItemText';
import ListIcon from '@mui/icons-material/List';
import TrendingUpIcon from '@mui/icons-material/TrendingUp';
2022-06-11 00:57:54 +00:00
import React from 'react';
2022-06-12 15:19:39 +00:00
import { makeStyles } from '@mui/styles';
2021-01-29 17:04:32 +00:00
2021-02-05 01:09:59 +00:00
const drawerWidth = 240;
2021-01-29 17:04:32 +00:00
const useStyles = makeStyles((theme) => ({
2022-06-11 00:57:54 +00:00
root: {
flexGrow: 1,
display: 'flex',
},
toolbar: {
paddingRight: 24, // keep right padding when drawer closed
},
toolbarIcon: {
display: 'flex',
alignItems: 'center',
justifyContent: 'flex-end',
padding: '0 8px',
...theme.mixins.toolbar,
},
appBarSpacer: theme.mixins.toolbar,
drawerPaper: {
[theme.breakpoints.up('sm')]: {
width: drawerWidth,
flexShrink: 0,
2021-02-05 01:09:59 +00:00
},
2022-06-11 00:57:54 +00:00
position: 'relative',
whiteSpace: 'nowrap',
transition: theme.transitions.create('width', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen,
}),
},
drawer: {
width: drawerWidth,
},
2021-01-29 17:04:32 +00:00
}));
export default function SideBar() {
2022-06-11 00:57:54 +00:00
const classes = useStyles();
2021-01-29 17:04:32 +00:00
2022-06-11 00:57:54 +00:00
return (
<Drawer
variant="permanent"
className={classes.drawer}
PaperProps={{
className: classes.drawerPaper,
}}
anchor={'left'}
open={true}
>
<div className={classes.appBarSpacer} />
2021-01-29 17:04:32 +00:00
2022-06-11 00:57:54 +00:00
<List>
<Link href={'/'}>
<ListItem button>
<ListItemIcon>
<DashboardIcon />
</ListItemIcon>
<ListItemText primary="Dashboard" />
</ListItem>
</Link>
</List>
<Divider />
<List>
<Link href={'/orders'}>
<ListItem button>
<ListItemIcon>
<ListIcon />
</ListItemIcon>
<ListItemText primary="Orders" />
</ListItem>
</Link>
<Link href={'/trades'}>
<ListItem button>
<ListItemIcon>
<ListIcon />
</ListItemIcon>
<ListItemText primary="Trades" />
</ListItem>
</Link>
2022-06-13 08:48:57 +00:00
<Link href={'/strategies'}>
<ListItem button>
<ListItemIcon>
<TrendingUpIcon />
</ListItemIcon>
<ListItemText primary="Strategies" />
</ListItem>
</Link>
2022-06-11 00:57:54 +00:00
</List>
2021-01-29 17:04:32 +00:00
</Drawer>
2022-06-11 00:57:54 +00:00
);
2021-01-29 17:04:32 +00:00
}