diff options
Diffstat (limited to 'modern')
-rw-r--r-- | modern/src/other/GeofencesPage.js | 12 | ||||
-rw-r--r-- | modern/src/reports/components/Graph.js | 4 |
2 files changed, 10 insertions, 6 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; diff --git a/modern/src/reports/components/Graph.js b/modern/src/reports/components/Graph.js index 2a95ba96..88b51493 100644 --- a/modern/src/reports/components/Graph.js +++ b/modern/src/reports/components/Graph.js @@ -1,5 +1,5 @@ import React from 'react'; -import { withWidth, makeStyles } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, } from 'recharts'; @@ -40,4 +40,4 @@ const Graph = ({ type, items }) => { ); }; -export default withWidth()(Graph); +export default Graph; |