Files
suwayomi-material-you-webui/src/components/TemporaryDrawer.tsx

108 lines
4.5 KiB
TypeScript
Raw Normal View History

/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
2021-01-26 23:32:12 +03:30
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
2020-12-24 16:50:50 +01:00
import React from 'react';
2021-09-09 17:51:22 +04:30
import makeStyles from '@mui/styles/makeStyles';
import Drawer from '@mui/material/Drawer';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import CollectionsBookmarkIcon from '@mui/icons-material/CollectionsBookmark';
import ExploreIcon from '@mui/icons-material/Explore';
import ExtensionIcon from '@mui/icons-material/Extension';
import GetAppIcon from '@mui/icons-material/GetApp';
2021-09-28 00:41:12 +03:30
import NewReleasesIcon from '@mui/icons-material/NewReleases';
2021-09-09 17:51:22 +04:30
import ListItemText from '@mui/material/ListItemText';
import SettingsIcon from '@mui/icons-material/Settings';
2020-12-24 16:50:50 +01:00
import { Link } from 'react-router-dom';
const useStyles = makeStyles({
list: {
width: 250,
},
});
interface IProps {
drawerOpen: boolean
2020-12-25 06:36:34 +03:30
2021-05-15 17:18:57 +04:30
setDrawerOpen: React.Dispatch<React.SetStateAction<boolean>>
2020-12-24 16:50:50 +01:00
}
export default function TemporaryDrawer({ drawerOpen, setDrawerOpen }: IProps) {
const classes = useStyles();
return (
<div>
<Drawer
open={drawerOpen}
anchor="left"
onClose={() => setDrawerOpen(false)}
>
2021-03-18 21:46:24 +03:30
<div
className={classes.list}
role="presentation"
onClick={() => setDrawerOpen(false)}
onKeyDown={() => setDrawerOpen(false)}
>
<List>
2021-10-18 14:27:19 +03:30
<Link to="/library" style={{ color: 'inherit', textDecoration: 'none' }}>
<ListItem button key="Library">
<ListItemIcon>
<CollectionsBookmarkIcon />
</ListItemIcon>
<ListItemText primary="Library" />
</ListItem>
</Link>
2021-09-28 00:41:12 +03:30
2021-10-18 14:27:19 +03:30
<Link to="/updates" style={{ color: 'inherit', textDecoration: 'none' }}>
<ListItem button key="Updates">
<ListItemIcon>
<NewReleasesIcon />
</ListItemIcon>
<ListItemText primary="Updates" />
</ListItem>
</Link>
<Link to="/manga/extensions" style={{ color: 'inherit', textDecoration: 'none' }}>
2021-03-18 21:46:24 +03:30
<ListItem button key="Extensions">
<ListItemIcon>
2021-05-23 13:48:02 +04:30
<ExtensionIcon />
2021-03-18 21:46:24 +03:30
</ListItemIcon>
2021-07-31 04:14:48 +04:30
<ListItemText primary="Extensions" />
</ListItem>
</Link>
2021-10-18 14:27:19 +03:30
<Link to="/manga/sources" style={{ color: 'inherit', textDecoration: 'none' }}>
2021-03-18 21:46:24 +03:30
<ListItem button key="Sources">
<ListItemIcon>
2021-05-23 13:48:02 +04:30
<ExploreIcon />
2021-03-18 21:46:24 +03:30
</ListItemIcon>
2021-07-31 04:14:48 +04:30
<ListItemText primary="Sources" />
2021-05-27 17:13:22 +04:30
</ListItem>
</Link>
2021-10-18 14:27:19 +03:30
<Link to="/manga/downloads" style={{ color: 'inherit', textDecoration: 'none' }}>
<ListItem button key="Manga Download Queue">
<ListItemIcon>
<GetAppIcon />
</ListItemIcon>
<ListItemText primary="Downloads" />
</ListItem>
</Link>
2021-03-18 21:46:24 +03:30
<Link to="/settings" style={{ color: 'inherit', textDecoration: 'none' }}>
<ListItem button key="settings">
<ListItemIcon>
2021-05-23 13:48:02 +04:30
<SettingsIcon />
2021-03-18 21:46:24 +03:30
</ListItemIcon>
<ListItemText primary="Settings" />
</ListItem>
</Link>
</List>
</div>
2020-12-24 16:50:50 +01:00
</Drawer>
</div>
);
}