aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-08-29 15:21:41 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-08-29 15:21:41 -0700
commit83da550a8d080bf553486c16247d5815de0b212d (patch)
treef48d4826a6a0403857c455b0ec5f4406ecfe16ca /modern
parentd25a09148e4aa1d1a8dd881d77349aca0a964bfc (diff)
downloadtrackermap-web-83da550a8d080bf553486c16247d5815de0b212d.tar.gz
trackermap-web-83da550a8d080bf553486c16247d5815de0b212d.tar.bz2
trackermap-web-83da550a8d080bf553486c16247d5815de0b212d.zip
Fix settings navigation (fix #897)
Diffstat (limited to 'modern')
-rw-r--r--modern/src/GeofencesPage.js4
-rw-r--r--modern/src/reports/ReportLayout.js4
-rw-r--r--modern/src/settings/OptionsLayout/index.js5
3 files changed, 7 insertions, 6 deletions
diff --git a/modern/src/GeofencesPage.js b/modern/src/GeofencesPage.js
index 71219c16..31a99fa9 100644
--- a/modern/src/GeofencesPage.js
+++ b/modern/src/GeofencesPage.js
@@ -11,6 +11,7 @@ import GeofenceEditMap from './map/GeofenceEditMap';
import GeofencesList from './GeofencesList';
import t from './common/localization';
+import { useHistory } from 'react-router-dom';
const useStyles = makeStyles((theme) => ({
root: {
@@ -49,6 +50,7 @@ const useStyles = makeStyles((theme) => ({
const GeofencesPage = ({ width }) => {
const classes = useStyles();
+ const history = useHistory();
return (
<div className={classes.root}>
@@ -59,7 +61,7 @@ const GeofencesPage = ({ width }) => {
classes={{ paper: classes.drawerPaper }}
>
<div className={classes.drawerHeader}>
- <IconButton component="a" href="/">
+ <IconButton onClick={() => history.goBack()}>
<ArrowBackIcon />
</IconButton>
<Typography variant="h6" color="inherit" noWrap>
diff --git a/modern/src/reports/ReportLayout.js b/modern/src/reports/ReportLayout.js
index c231cd80..69487f28 100644
--- a/modern/src/reports/ReportLayout.js
+++ b/modern/src/reports/ReportLayout.js
@@ -100,9 +100,7 @@ const ReportLayout = ({ children, filter }) => {
classes={{ root: classes.drawerContainer, paper: classes.drawer }}
>
<div className={classes.drawerHeader}>
- <IconButton
- onClick={() => history.push('/')}
- >
+ <IconButton onClick={() => history.push('/')}>
<ArrowBackIcon />
</IconButton>
<Typography variant="h6" color="inherit" noWrap>
diff --git a/modern/src/settings/OptionsLayout/index.js b/modern/src/settings/OptionsLayout/index.js
index 4a42e583..625148d0 100644
--- a/modern/src/settings/OptionsLayout/index.js
+++ b/modern/src/settings/OptionsLayout/index.js
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
-import { useLocation } from 'react-router-dom';
+import { useHistory, useLocation } from 'react-router-dom';
import {
Typography,
Divider,
@@ -53,6 +53,7 @@ const useStyles = makeStyles((theme) => ({
const OptionsLayout = ({ children }) => {
const classes = useStyles();
const location = useLocation();
+ const history = useHistory();
const [openDrawer, setOpenDrawer] = useState(false);
const [optionTitle, setOptionTitle] = useState();
const routes = useRoutes();
@@ -86,7 +87,7 @@ const OptionsLayout = ({ children }) => {
classes={{ root: classes.drawerContainer, paper: classes.drawer }}
>
<div className={classes.drawerHeader}>
- <IconButton component="a" href="/">
+ <IconButton onClick={() => history.push('/')}>
<ArrowBackIcon />
</IconButton>
<Typography variant="h6" color="inherit" noWrap>