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

113 lines
4.9 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';
import { makeStyles } from '@material-ui/core/styles';
import Drawer from '@material-ui/core/Drawer';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
2021-05-23 13:48:02 +04:30
import CollectionsBookmarkIcon from '@material-ui/icons/CollectionsBookmark';
import ExploreIcon from '@material-ui/icons/Explore';
import ExtensionIcon from '@material-ui/icons/Extension';
2021-05-30 04:01:49 +04:30
import GetAppIcon from '@material-ui/icons/GetApp';
2020-12-24 16:50:50 +01:00
import ListItemText from '@material-ui/core/ListItemText';
2021-05-23 13:48:02 +04:30
import SettingsIcon from '@material-ui/icons/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>
<Link to="/library" style={{ color: 'inherit', textDecoration: 'none' }}>
<ListItem button key="Library">
<ListItemIcon>
2021-05-23 13:48:02 +04:30
<CollectionsBookmarkIcon />
2021-03-18 21:46:24 +03:30
</ListItemIcon>
<ListItemText primary="Library" />
</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>
<ListItemText primary="Manga Extensions" />
</ListItem>
</Link>
<Link to="/anime/extensions" style={{ color: 'inherit', textDecoration: 'none' }}>
<ListItem button key="Extensions">
<ListItemIcon>
<ExtensionIcon />
</ListItemIcon>
<ListItemText primary="Anime Extensions" />
2021-03-18 21:46:24 +03:30
</ListItem>
</Link>
2021-05-27 17:13:22 +04: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-05-27 17:13:22 +04:30
<ListItemText primary="Manga Sources" />
</ListItem>
</Link>
<Link to="/anime/sources" style={{ color: 'inherit', textDecoration: 'none' }}>
<ListItem button key="Sources">
<ListItemIcon>
<ExploreIcon />
</ListItemIcon>
<ListItemText primary="Anime Sources" />
2021-03-18 21:46:24 +03:30
</ListItem>
</Link>
2021-05-30 04:01:49 +04:30
<Link to="/manga/downloads" style={{ color: 'inherit', textDecoration: 'none' }}>
<ListItem button key="Manga Download Queue">
<ListItemIcon>
<GetAppIcon />
</ListItemIcon>
<ListItemText primary="Manga Download Queue" />
</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>
);
}