aboutsummaryrefslogtreecommitdiff
path: root/modern/src/GeofencesPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-06-27 11:08:26 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-06-27 11:08:26 -0700
commit26916278758cd5e4abb16aa31e31099e066ea8d5 (patch)
tree5119a65f67cd426ed06b9cb553b7d24ba6dce093 /modern/src/GeofencesPage.js
parentd86a3ef187359fbe83a5dd950295868c4ef39d09 (diff)
downloadtrackermap-web-26916278758cd5e4abb16aa31e31099e066ea8d5.tar.gz
trackermap-web-26916278758cd5e4abb16aa31e31099e066ea8d5.tar.bz2
trackermap-web-26916278758cd5e4abb16aa31e31099e066ea8d5.zip
Add geofences screen
Diffstat (limited to 'modern/src/GeofencesPage.js')
-rw-r--r--modern/src/GeofencesPage.js66
1 files changed, 66 insertions, 0 deletions
diff --git a/modern/src/GeofencesPage.js b/modern/src/GeofencesPage.js
new file mode 100644
index 00000000..389ac998
--- /dev/null
+++ b/modern/src/GeofencesPage.js
@@ -0,0 +1,66 @@
+import React from 'react';
+import { isWidthUp, makeStyles, withWidth } from '@material-ui/core';
+import Drawer from '@material-ui/core/Drawer';
+import ContainerDimensions from 'react-container-dimensions';
+import MainToolbar from './MainToolbar';
+import Map from './map/Map';
+import CurrentLocationMap from './map/CurrentLocationMap';
+import GeofenceEditMap from './map/GeofenceEditMap';
+import GeofencesList from './GeofencesList';
+
+const useStyles = makeStyles(theme => ({
+ root: {
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ },
+ content: {
+ flexGrow: 1,
+ overflow: 'hidden',
+ display: 'flex',
+ flexDirection: 'row',
+ [theme.breakpoints.down('xs')]: {
+ flexDirection: 'column-reverse',
+ }
+ },
+ drawerPaper: {
+ position: 'relative',
+ [theme.breakpoints.up('sm')]: {
+ width: 350,
+ },
+ [theme.breakpoints.down('xs')]: {
+ height: 250,
+ }
+ },
+ mapContainer: {
+ flexGrow: 1,
+ },
+}));
+
+const GeofencesPage = ({ width }) => {
+ const classes = useStyles();
+
+ return (
+ <div className={classes.root}>
+ <MainToolbar />
+ <div className={classes.content}>
+ <Drawer
+ anchor={isWidthUp('sm', width) ? 'left' : 'bottom'}
+ variant='permanent'
+ classes={{ paper: classes.drawerPaper }}>
+ <GeofencesList />
+ </Drawer>
+ <div className={classes.mapContainer}>
+ <ContainerDimensions>
+ <Map>
+ <CurrentLocationMap />
+ <GeofenceEditMap />
+ </Map>
+ </ContainerDimensions>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+export default withWidth()(GeofencesPage);