import React, { Component } from 'react'; import { Link } from 'react-router-dom' import PropTypes from 'prop-types'; import AppBar from '@material-ui/core/AppBar'; import CssBaseline from '@material-ui/core/CssBaseline'; import Divider from '@material-ui/core/Divider'; import Drawer from '@material-ui/core/Drawer'; import Hidden from '@material-ui/core/Hidden'; import IconButton from '@material-ui/core/IconButton'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemText from '@material-ui/core/ListItemText'; import MenuIcon from '@material-ui/icons/Menu'; import Toolbar from '@material-ui/core/Toolbar'; import Typography from '@material-ui/core/Typography'; import { withStyles } from '@material-ui/core/styles'; import matrixLogo from '../../images/matrix-logo.svg'; const drawerWidth = 180; const styles = theme => ({ root: { display: 'flex', }, drawer: { [theme.breakpoints.up('sm')]: { width: drawerWidth, flexShrink: 0, }, }, appBar: { marginLeft: drawerWidth, [theme.breakpoints.up('sm')]: { width: `calc(100% - ${drawerWidth}px)`, }, }, menuButton: { marginRight: 20, [theme.breakpoints.up('sm')]: { display: 'none', }, }, toolbar: theme.mixins.toolbar, drawerPaper: { width: drawerWidth, }, content: { flexGrow: 1, padding: theme.spacing(3), }, }); class Layout extends Component { static propTypes = { children: PropTypes.node, classes: PropTypes.object.isRequired, theme: PropTypes.object.isRequired, }; state = { mobileOpen: false, }; handleDrawerToggle = () => { this.setState(state => ({ mobileOpen: !state.mobileOpen })); }; render() { const { classes, theme } = this.props; const { pathname } = this.props.location; const drawer = (