import React from 'react'; import clsx from 'clsx'; import { makeStyles } from '@material-ui/core/styles'; import SwipeableDrawer from '@material-ui/core/SwipeableDrawer'; import Button from '@material-ui/core/Button'; import List from '@material-ui/core/List'; import Divider from '@material-ui/core/Divider'; import ListItem from '@material-ui/core/ListItem'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText'; import InboxIcon from '@material-ui/icons/MoveToInbox'; import MailIcon from '@material-ui/icons/Mail'; const useStyles = makeStyles({ list: { width: 250, }, fullList: { width: 'auto', }, }); type Anchor = 'top' | 'left' | 'bottom' | 'right'; export default function SwipeableTemporaryDrawer() { const classes = useStyles(); const [state, setState] = React.useState({ top: false, left: false, bottom: false, right: false, }); const toggleDrawer = (anchor: Anchor, open: boolean) => ( event: React.KeyboardEvent | React.MouseEvent, ) => { if ( event && event.type === 'keydown' && ((event as React.KeyboardEvent).key === 'Tab' || (event as React.KeyboardEvent).key === 'Shift') ) { return; } setState({ ...state, [anchor]: open }); }; const list = (anchor: Anchor) => (