/* * 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 '@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 CollectionsBookmarkOutlinedIcon from '@mui/icons-material/CollectionsBookmarkOutlined'; import VideoLibraryOutlinedIcon from '@mui/icons-material/VideoLibraryOutlined'; import ExploreIcon from '@mui/icons-material/Explore'; import ExtensionIcon from '@mui/icons-material/Extension'; import GetAppIcon from '@mui/icons-material/GetApp'; import ListItemText from '@mui/material/ListItemText'; import SettingsIcon from '@mui/icons-material/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' && }
); }