Skip to content

Commit

Permalink
Fix geofences delete toast
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Oct 14, 2024
1 parent 2eda381 commit 363d8c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/other/GeofencesList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useCatchCallback } from '../reactHelper';

const useStyles = makeStyles(() => ({
list: {
maxHeight: '100%',
flexGrow: 1,
overflow: 'auto',
},
icon: {
Expand Down
23 changes: 7 additions & 16 deletions src/other/GeofencesPage.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
import {
Divider, Typography, IconButton, useMediaQuery, Toolbar,
Divider, Typography, IconButton, Toolbar,
Paper,
} from '@mui/material';
import Tooltip from '@mui/material/Tooltip';
import makeStyles from '@mui/styles/makeStyles';
import { useTheme } from '@mui/material/styles';
import Drawer from '@mui/material/Drawer';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import UploadFileIcon from '@mui/icons-material/UploadFile';
import { useNavigate } from 'react-router-dom';
Expand Down Expand Up @@ -35,13 +34,13 @@ const useStyles = makeStyles((theme) => ({
},
},
drawer: {
zIndex: 1,
position: 'relative !important',
display: 'flex',
flexDirection: 'column',
[theme.breakpoints.up('sm')]: {
width: theme.dimensions.drawerWidthDesktop,
},
[theme.breakpoints.down('sm')]: {
height: `${theme.dimensions.drawerHeightPhone} !important`,
height: theme.dimensions.drawerHeightPhone,
},
},
mapContainer: {
Expand All @@ -56,14 +55,11 @@ const useStyles = makeStyles((theme) => ({
}));

const GeofencesPage = () => {
const theme = useTheme();
const classes = useStyles();
const dispatch = useDispatch();
const navigate = useNavigate();
const t = useTranslation();

const isPhone = useMediaQuery(theme.breakpoints.down('sm'));

const [selectedGeofenceId, setSelectedGeofenceId] = useState();

const handleFile = (event) => {
Expand Down Expand Up @@ -103,12 +99,7 @@ const GeofencesPage = () => {
return (
<div className={classes.root}>
<div className={classes.content}>
<Drawer
className={classes.drawer}
anchor={isPhone ? 'bottom' : 'left'}
variant="permanent"
classes={{ paper: classes.drawer }}
>
<Paper square className={classes.drawer}>
<Toolbar>
<IconButton edge="start" sx={{ mr: 2 }} onClick={() => navigate(-1)}>
<ArrowBackIcon />
Expand All @@ -125,7 +116,7 @@ const GeofencesPage = () => {
</Toolbar>
<Divider />
<GeofencesList onGeofenceSelected={setSelectedGeofenceId} />
</Drawer>
</Paper>
<div className={classes.mapContainer}>
<MapView>
<MapGeofenceEdit selectedGeofenceId={selectedGeofenceId} />
Expand Down

0 comments on commit 363d8c3

Please sign in to comment.