From 5d81e6dfe6f7e6fd9579f2527f83b27c5494b887 Mon Sep 17 00:00:00 2001 From: Ashutosh Bishnoi Date: Fri, 14 May 2021 18:02:48 +0530 Subject: Initial Report Sidebar Draft --- modern/src/reports/ReportLayoutPage.js | 107 +++++++++++++++++++++++++++------ 1 file changed, 88 insertions(+), 19 deletions(-) diff --git a/modern/src/reports/ReportLayoutPage.js b/modern/src/reports/ReportLayoutPage.js index e5eda05e..c5e13fdf 100644 --- a/modern/src/reports/ReportLayoutPage.js +++ b/modern/src/reports/ReportLayoutPage.js @@ -1,18 +1,41 @@ -import React from 'react'; -import { Grid, Paper, makeStyles } from '@material-ui/core'; -import MainToolbar from '../MainToolbar'; +import React, { useState } from 'react'; +import { AppBar, Toolbar, Typography, List, ListItem, ListItemText, ListItemIcon, Divider, Grid, Paper, Drawer, makeStyles, useMediaQuery, IconButton } from '@material-ui/core'; +import { useTheme } from "@material-ui/core/styles"; +import MenuIcon from '@material-ui/icons/Menu'; +import TimelineIcon from '@material-ui/icons/Timeline'; +import PauseCircleFilledIcon from '@material-ui/icons/PauseCircleFilled'; +import PlayCircleFilledIcon from '@material-ui/icons/PlayCircleFilled'; +import NotificationsActiveIcon from '@material-ui/icons/NotificationsActive'; +import FormatListBulletedIcon from '@material-ui/icons/FormatListBulleted'; +import TrendingUpIcon from '@material-ui/icons/TrendingUp'; +import ChevronLeftIcon from '@material-ui/icons/ChevronLeft'; + +import { Link } from "react-router-dom"; + +import t from '../common/localization'; const useStyles = makeStyles(theme => ({ root: { height: '100%', display: 'flex', - flexDirection: 'column', }, content: { flex: 1, overflow: 'auto', padding: theme.spacing(2), }, + drawer: { + width: 360, + [theme.breakpoints.down("md")]: { + width: 320, + } + }, + drawerHeader: { + ...theme.mixins.toolbar, + display: 'flex', + alignItems: 'center', + padding: theme.spacing(0, 1), + }, form: { padding: theme.spacing(1, 2, 2), }, @@ -20,23 +43,69 @@ const useStyles = makeStyles(theme => ({ const ReportLayoutPage = ({ children, filter }) => { const classes = useStyles(); + const theme = useTheme(); + const matchesMD = useMediaQuery(theme.breakpoints.down("md")); + const [openDrawer, setOpenDrawer] = useState(false); + + const routes = [ + { name: t('reportRoute'), link: '/reports/route', icon: , activeIndex: 0 }, + { name: t('reportEvents'), link: '/reports/event', icon: , activeIndex: 1 }, + { name: t('reportTrips'), link: '/reports/trip', icon: , activeIndex: 2 }, + { name: t('reportStops'), link: '/reports/stop', icon: , activeIndex: 3 }, + { name: t('reportSummary'), link: '/reports/summary', icon: , activeIndex: 4 }, + { name: t('reportChart'), link: '/reports/chart', icon: , activeIndex: 5 }, + ]; + return (
- -
- - - - {filter} - - - - - {children} - - - -
+ {matchesMD && + + setOpenDrawer(!openDrawer)} + className={classes.menuButton} + > + + + + Reports + + + + } + setOpenDrawer(!openDrawer)} + classes={{ paper: classes.drawer }} + > +
+ + + +
+ + + {routes.map(route => ( + setOpenDrawer(false)} + > + + {route.icon} + + + {route.name} + + + ))} + +
); } -- cgit v1.2.3