Skip to content

Commit

Permalink
cleanup route drawer code + rendering #10
Browse files Browse the repository at this point in the history
* remove underline from links
* remove dead code
* remove unused imports
  • Loading branch information
DominikHorn committed Feb 27, 2020
1 parent 58601f5 commit 07df1f7
Showing 1 changed file with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import * as React from 'react';
import {
SwipeableDrawer,
createStyles,
makeStyles,
Theme,
List,
Divider,
ListItem,
ListItemIcon,
ListItemText,
makeStyles,
SwipeableDrawer,
Theme,
} from '@material-ui/core';
import InboxIcon from '@material-ui/icons/MoveToInbox';
import MailIcon from '@material-ui/icons/Mail';
import { APP_ROUTES, getLinkDisplayNameForPage, getLinkForPage } from '../../../util/approutes';
import * as React from 'react';
import { Link } from 'react-router-dom';
import { APP_ROUTES, getLinkDisplayNameForPage, getLinkForPage } from '../../../util/approutes';
import h from '../../../util/history';

export interface RouteDrawerProps {
readonly isOpen: boolean;
Expand All @@ -39,22 +37,12 @@ export const RouteDrawer = (props: RouteDrawerProps) => {
<div className={classes.fullList} role={'presentation'} onClick={props.onClose} onKeyDown={props.onClose}>
<List>
{APP_ROUTES.map(route => (
<ListItem button={true} key={getLinkForPage(route)}>
<ListItem button={true} key={getLinkForPage(route)} onClick={() => h.push(getLinkForPage(route))}>
{route.icon && <ListItemIcon>{route.icon}</ListItemIcon>}
<Link to={getLinkForPage(route)}>
<ListItemText primary={getLinkDisplayNameForPage(route)} />
</Link>
<ListItemText primary={getLinkDisplayNameForPage(route)} />
</ListItem>
))}
</List>
{/** TODO: bellow is testing code */}
{/* <Divider />
{['Inbox', 'Starred', 'Send email', 'Drafts'].map((text, index) => (
<ListItem button={true} key={text}>
<ListItemIcon>{index % 2 === 0 ? <InboxIcon /> : <MailIcon />}</ListItemIcon>
<ListItemText primary={text} />
</ListItem>
))} */}
</div>
</SwipeableDrawer>
);
Expand Down

0 comments on commit 07df1f7

Please sign in to comment.