/* * Copyright (C) Contributors to the Suwayomi project * * This Source Code Form is subject to the terms of the Mozilla Public * 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/. */ 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'; import CollectionsBookmarkIcon from '@material-ui/icons/CollectionsBookmark'; import CollectionsBookmarkOutlinedIcon from '@material-ui/icons/CollectionsBookmarkOutlined'; import VideoLibraryOutlinedIcon from '@material-ui/icons/VideoLibraryOutlined'; import ExploreIcon from '@material-ui/icons/Explore'; import ExtensionIcon from '@material-ui/icons/Extension'; import GetAppIcon from '@material-ui/icons/GetApp'; import ListItemText from '@material-ui/core/ListItemText'; import SettingsIcon from '@material-ui/icons/Settings'; import { Link } from 'react-router-dom'; import useLocalStorage from 'util/useLocalStorage'; const useStyles = makeStyles({ list: { width: 250, }, }); interface IProps { drawerOpen: boolean setDrawerOpen: React.Dispatch> } export default function TemporaryDrawer({ drawerOpen, setDrawerOpen }: IProps) { const classes = useStyles(); const [workingMode, setWorkingMode] = useLocalStorage<'manga'|'anime'>('workingMode', 'manga'); const otherMode = () => { if (workingMode === 'manga') return 'Anime'; return 'Manga'; }; const switchMode = () => { if (workingMode === 'manga') setWorkingMode('anime'); else setWorkingMode('manga'); }; return (
setDrawerOpen(false)} >
setDrawerOpen(false)} onKeyDown={() => setDrawerOpen(false)} > {workingMode === 'manga' && ( )} {workingMode === 'manga' && ( )} {workingMode === 'manga' && } {workingMode === 'anime' && }
); }