From a4ee9b57c9433502567736d994826c8dd95ee5f0 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 5 Aug 2020 17:53:16 +0300 Subject: [PATCH] Fix sidemenu and drawer menu icon for the home routes. --- src/App.tsx | 4 +++- src/SideMenu/index.tsx | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c1a6e26..a600ad1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -104,7 +104,9 @@ function AppBarWitHistory(props: AppBarPropsType) { function canGoBack() { return ( (history!.length > 1) && - (history!.location.pathname !== routeResolver.getRoute("pim")) && + (history!.location.pathname !== routeResolver.getRoute("pim.contacts")) && + (history!.location.pathname !== routeResolver.getRoute("pim.events")) && + (history!.location.pathname !== routeResolver.getRoute("pim.tasks")) && (history!.location.pathname !== routeResolver.getRoute("home")) ); } diff --git a/src/SideMenu/index.tsx b/src/SideMenu/index.tsx index ddbe23a..cd48c1f 100644 --- a/src/SideMenu/index.tsx +++ b/src/SideMenu/index.tsx @@ -21,7 +21,7 @@ import { logout } from "../store/actions"; import * as C from "../constants"; import { useTheme } from "@material-ui/core"; -import { useCredentials } from "../login"; +import { useCredentials } from "../credentials"; import { useHistory } from "react-router"; interface PropsType { @@ -30,17 +30,17 @@ interface PropsType { export default function SideMenu(props: PropsType) { const theme = useTheme(); - const etesync = useCredentials(); - const username = etesync?.credentials.email ?? C.appName; + const etebase = useCredentials(); + const username = etebase?.user.username ?? C.appName; const history = useHistory(); function logoutDo() { - store.dispatch(logout(etesync! as any)); + store.dispatch(logout(etebase!)); props.onCloseDrawerRequest(); } let loggedInItems; - if (etesync) { + if (etebase) { loggedInItems = (