From c8442d9440b241bba0bc7b0b07230f997c9006eb Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sat, 8 Aug 2020 11:58:17 +0300 Subject: [PATCH] Appbar: remove the useless back button - always open the menu. Fixes #161 --- src/App.tsx | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c1a6e26..ad3b508 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,7 +4,6 @@ import * as React from "react"; import { List as ImmutableList } from "immutable"; import { connect, useDispatch } from "react-redux"; -import { useHistory } from "react-router"; import { BrowserRouter } from "react-router-dom"; import { MuiThemeProvider as ThemeProvider, createMuiTheme } from "@material-ui/core/styles"; // v1.x import amber from "@material-ui/core/colors/amber"; @@ -16,7 +15,6 @@ import IconButton from "@material-ui/core/IconButton"; import Badge from "@material-ui/core/Badge"; import NavigationMenu from "@material-ui/icons/Menu"; -import NavigationBack from "@material-ui/icons/ArrowBack"; import NavigationRefresh from "@material-ui/icons/Refresh"; import ErrorsIcon from "@material-ui/icons/Error"; @@ -99,19 +97,6 @@ interface AppBarPropsType { } function AppBarWitHistory(props: AppBarPropsType) { - const history = useHistory(); - - function canGoBack() { - return ( - (history!.length > 1) && - (history!.location.pathname !== routeResolver.getRoute("pim")) && - (history!.location.pathname !== routeResolver.getRoute("home")) - ); - } - - function goBack() { - history!.goBack(); - } const { toggleDrawerIcon, iconElementRight, @@ -124,10 +109,7 @@ function AppBarWitHistory(props: AppBarPropsType) { >
- {!canGoBack() ? - toggleDrawerIcon : - - } + {toggleDrawerIcon}