import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import { withStyles } from '@material-ui/core/styles'; import Drawer from '@material-ui/core/Drawer'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; import Typography from '@material-ui/core/Typography'; import IconButton from '@material-ui/core/IconButton'; import Hidden from '@material-ui/core/Hidden'; import Divider from '@material-ui/core/Divider'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText'; import MenuIcon from '@material-ui/icons/Menu'; import WifiIcon from '@material-ui/icons/Wifi'; import SystemUpdateIcon from '@material-ui/icons/SystemUpdate'; import AccessTimeIcon from '@material-ui/icons/AccessTime'; import SettingsInputAntennaIcon from '@material-ui/icons/SettingsInputAntenna'; import { APP_NAME } from '../constants/App'; const drawerWidth = 290; const styles = theme => ({ root: { zIndex: 1, width: '100%', height: '100%', }, toolbar: { paddingLeft: theme.spacing.unit, paddingRight: theme.spacing.unit, [theme.breakpoints.up('md')]: { paddingLeft: theme.spacing.unit * 3, paddingRight: theme.spacing.unit * 3, } }, appFrame: { position: 'relative', display: 'flex', width: '100%', height: '100%', }, appBar: { position: 'absolute', marginLeft: drawerWidth, [theme.breakpoints.up('md')]: { width: `calc(100% - ${drawerWidth}px)`, }, }, navIconHide: { [theme.breakpoints.up('md')]: { display: 'none', }, }, drawerPaper: { width: drawerWidth, height: '100%', [theme.breakpoints.up('md')]: { width: drawerWidth, position:'fixed', left:0, top:0, overflow:'auto' }, }, content: { backgroundColor: theme.palette.background.default, width:"100%", marginTop: 56, [theme.breakpoints.up('md')]: { paddingLeft: drawerWidth }, [theme.breakpoints.up('sm')]: { height: 'calc(100% - 64px)', marginTop: 64, }, }, }); class MenuAppBar extends React.Component { state = { mobileOpen: false, }; handleDrawerToggle = () => { this.setState({ mobileOpen: !this.state.mobileOpen }); }; render() { const { classes, theme, children, sectionTitle } = this.props; const drawer = (
{APP_NAME}
); return (
{sectionTitle} {drawer} {drawer}
{children}
); } } MenuAppBar.propTypes = { classes: PropTypes.object.isRequired, theme: PropTypes.object.isRequired, sectionTitle: PropTypes.string.isRequired, }; export default withStyles(styles, { withTheme: true })(MenuAppBar);