diff options
-rw-r--r-- | modern/src/MainPage.js | 38 | ||||
-rw-r--r-- | modern/src/MainToolbar.js | 200 |
2 files changed, 121 insertions, 117 deletions
diff --git a/modern/src/MainPage.js b/modern/src/MainPage.js index f6dd7fe..4362569 100644 --- a/modern/src/MainPage.js +++ b/modern/src/MainPage.js @@ -53,26 +53,28 @@ const MainPage = () => { }); }, [history]); - return (loading ? (<div>Loading...</div>) : (<div className={classes.root}> - <SocketController /> - <MainToobar /> - <div className={classes.content}> - { /* <Drawer - anchor={isWidthUp('sm', this.props.width) ? "left" : "bottom"} NOTE: What's this do? - variant="permanent" - classes={{ paper: classes.drawerPaper }}> */} - <Drawer - variant="permanent" - classes={{ paper: classes.drawerPaper }}> - <DeviceList /> - </Drawer> - <div className={classes.mapContainer}> - <ContainerDimensions> - <MainMap /> - </ContainerDimensions> + return loading ? (<div>Loading...</div>) : ( + <div className={classes.root}> + <SocketController /> + <MainToobar /> + <div className={classes.content}> + {/* <Drawer + anchor={isWidthUp('sm', this.props.width) ? "left" : "bottom"} NOTE: What's this do? + variant="permanent" + classes={{ paper: classes.drawerPaper }}> */} + <Drawer + variant="permanent" + classes={{ paper: classes.drawerPaper }}> + <DeviceList /> + </Drawer> + <div className={classes.mapContainer}> + <ContainerDimensions> + <MainMap /> + </ContainerDimensions> + </div> </div> </div> - </div>)); + ); } export default MainPage; diff --git a/modern/src/MainToolbar.js b/modern/src/MainToolbar.js index 9c2e811..bf4aa40 100644 --- a/modern/src/MainToolbar.js +++ b/modern/src/MainToolbar.js @@ -51,106 +51,108 @@ const MainToolbar = () => { }) } - return (<> - <AppBar position="static" className={classes.appBar}> - <Toolbar> - <IconButton - className={classes.menuButton} - color="inherit" - onClick={openDrawer}> - <MenuIcon /> - </IconButton> - <Typography variant="h6" color="inherit" className={classes.flex}> - Traccar + return ( + <> + <AppBar position="static" className={classes.appBar}> + <Toolbar> + <IconButton + className={classes.menuButton} + color="inherit" + onClick={openDrawer}> + <MenuIcon /> + </IconButton> + <Typography variant="h6" color="inherit" className={classes.flex}> + Traccar </Typography> - <Button color="inherit" onClick={handleLogout}>{t('loginLogout')}</Button> - </Toolbar> - </AppBar> - <Drawer open={drawer} onClose={closeDrawer}> - <div - tabIndex={0} - className={classes.list} - role="button" - onClick={closeDrawer} - onKeyDown={closeDrawer}> - <List> - <ListItem button onClick={() => history.push('/')}> - <ListItemIcon> - <DashboardIcon /> - </ListItemIcon> - <ListItemText primary={t('mapTitle')} /> - </ListItem> - </List> - <Divider /> - <List subheader={<ListSubheader> - {t('reportTitle')} - </ListSubheader>}> - <ListItem button onClick={() => { history.push('/reports/route') }}> - <ListItemIcon> - <BarChartIcon /> - </ListItemIcon> - <ListItemText primary={t('reportRoute')} /> - </ListItem> - <ListItem button disabled> - <ListItemIcon> - <BarChartIcon /> - </ListItemIcon> - <ListItemText primary={t('reportEvents')} /> - </ListItem> - <ListItem button disabled> - <ListItemIcon> - <BarChartIcon /> - </ListItemIcon> - <ListItemText primary={t('reportTrips')} /> - </ListItem> - <ListItem button disabled> - <ListItemIcon> - <BarChartIcon /> - </ListItemIcon> - <ListItemText primary={t('reportStops')} /> - </ListItem> - <ListItem button disabled> - <ListItemIcon> - <BarChartIcon /> - </ListItemIcon> - <ListItemText primary={t('reportSummary')} /> - </ListItem> - <ListItem button disabled> - <ListItemIcon> - <BarChartIcon /> - </ListItemIcon> - <ListItemText primary={t('reportChart')} /> - </ListItem> - </List> - <Divider /> - <List - subheader={ - <ListSubheader> - {t('settingsTitle')} - </ListSubheader> - }> - <ListItem button disabled> - <ListItemIcon> - <SettingsIcon /> - </ListItemIcon> - <ListItemText primary={t('settingsUser')} /> - </ListItem> - <ListItem button disabled> - <ListItemIcon> - <SettingsIcon /> - </ListItemIcon> - <ListItemText primary={t('settingsServer')} /> - </ListItem> - <ListItem button disabled> - <ListItemIcon> - <SettingsIcon /> - </ListItemIcon> - <ListItemText primary={t('sharedNotifications')} /> - </ListItem> - </List> - </div> - </Drawer> - </>); + <Button color="inherit" onClick={handleLogout}>{t('loginLogout')}</Button> + </Toolbar> + </AppBar> + <Drawer open={drawer} onClose={closeDrawer}> + <div + tabIndex={0} + className={classes.list} + role="button" + onClick={closeDrawer} + onKeyDown={closeDrawer}> + <List> + <ListItem button onClick={() => history.push('/')}> + <ListItemIcon> + <DashboardIcon /> + </ListItemIcon> + <ListItemText primary={t('mapTitle')} /> + </ListItem> + </List> + <Divider /> + <List subheader={<ListSubheader> + {t('reportTitle')} + </ListSubheader>}> + <ListItem button onClick={() => { history.push('/reports/route') }}> + <ListItemIcon> + <BarChartIcon /> + </ListItemIcon> + <ListItemText primary={t('reportRoute')} /> + </ListItem> + <ListItem button disabled> + <ListItemIcon> + <BarChartIcon /> + </ListItemIcon> + <ListItemText primary={t('reportEvents')} /> + </ListItem> + <ListItem button disabled> + <ListItemIcon> + <BarChartIcon /> + </ListItemIcon> + <ListItemText primary={t('reportTrips')} /> + </ListItem> + <ListItem button disabled> + <ListItemIcon> + <BarChartIcon /> + </ListItemIcon> + <ListItemText primary={t('reportStops')} /> + </ListItem> + <ListItem button disabled> + <ListItemIcon> + <BarChartIcon /> + </ListItemIcon> + <ListItemText primary={t('reportSummary')} /> + </ListItem> + <ListItem button disabled> + <ListItemIcon> + <BarChartIcon /> + </ListItemIcon> + <ListItemText primary={t('reportChart')} /> + </ListItem> + </List> + <Divider /> + <List + subheader={ + <ListSubheader> + {t('settingsTitle')} + </ListSubheader> + }> + <ListItem button disabled> + <ListItemIcon> + <SettingsIcon /> + </ListItemIcon> + <ListItemText primary={t('settingsUser')} /> + </ListItem> + <ListItem button disabled> + <ListItemIcon> + <SettingsIcon /> + </ListItemIcon> + <ListItemText primary={t('settingsServer')} /> + </ListItem> + <ListItem button disabled> + <ListItemIcon> + <SettingsIcon /> + </ListItemIcon> + <ListItemText primary={t('sharedNotifications')} /> + </ListItem> + </List> + </div> + </Drawer> + </> + ); } export default MainToolbar; |