aboutsummaryrefslogtreecommitdiff
path: root/modern/src/other/GeofencesPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-08 14:18:00 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-08 14:18:00 -0700
commite9f85e4559b83bcca479969663ae6df80d97f803 (patch)
tree020f721d1cfee47564f8de4b5de8105d9002af19 /modern/src/other/GeofencesPage.js
parent3ad1ca72cabbf2294d06e4d7891abf889a0b7a62 (diff)
downloadtrackermap-web-e9f85e4559b83bcca479969663ae6df80d97f803.tar.gz
trackermap-web-e9f85e4559b83bcca479969663ae6df80d97f803.tar.bz2
trackermap-web-e9f85e4559b83bcca479969663ae6df80d97f803.zip
Remove legacy code
Diffstat (limited to 'modern/src/other/GeofencesPage.js')
-rw-r--r--modern/src/other/GeofencesPage.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/modern/src/other/GeofencesPage.js b/modern/src/other/GeofencesPage.js
index 79eed22a..c8144991 100644
--- a/modern/src/other/GeofencesPage.js
+++ b/modern/src/other/GeofencesPage.js
@@ -1,7 +1,8 @@
import React from 'react';
import {
- Divider, isWidthUp, makeStyles, withWidth, Typography, IconButton,
+ Divider, makeStyles, Typography, IconButton, useMediaQuery,
} from '@material-ui/core';
+import { useTheme } from '@material-ui/core/styles';
import Drawer from '@material-ui/core/Drawer';
import ContainerDimensions from 'react-container-dimensions';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
@@ -47,16 +48,19 @@ const useStyles = makeStyles((theme) => ({
},
}));
-const GeofencesPage = ({ width }) => {
+const GeofencesPage = () => {
+ const theme = useTheme();
const classes = useStyles();
const history = useHistory();
const t = useTranslation();
+ const isPhone = useMediaQuery(theme.breakpoints.down('xs'));
+
return (
<div className={classes.root}>
<div className={classes.content}>
<Drawer
- anchor={isWidthUp('sm', width) ? 'left' : 'bottom'}
+ anchor={isPhone ? 'bottom' : 'left'}
variant="permanent"
classes={{ paper: classes.drawerPaper }}
>
@@ -84,4 +88,4 @@ const GeofencesPage = ({ width }) => {
);
};
-export default withWidth()(GeofencesPage);
+export default GeofencesPage;