From dc50ef356609221731f05576a4b7108d1f7d4285 Mon Sep 17 00:00:00 2001 From: Jordan Knott Date: Tue, 5 Jan 2021 19:10:07 -0600 Subject: [PATCH] refactor: change nav icons to use Link instead of history.push --- frontend/src/shared/components/TopNavbar/Styles.ts | 5 +++++ frontend/src/shared/components/TopNavbar/index.tsx | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/shared/components/TopNavbar/Styles.ts b/frontend/src/shared/components/TopNavbar/Styles.ts index 123ddb8..e70d04d 100644 --- a/frontend/src/shared/components/TopNavbar/Styles.ts +++ b/frontend/src/shared/components/TopNavbar/Styles.ts @@ -65,6 +65,11 @@ export const ProfileNameWrapper = styled.div` line-height: 1.25; `; +export const NavbarLink = styled(Link)` + margin-right: 20px; + cursor: pointer; +`; + export const IconContainerWrapper = styled.div<{ disabled?: boolean }>` margin-right: 20px; cursor: pointer; diff --git a/frontend/src/shared/components/TopNavbar/index.tsx b/frontend/src/shared/components/TopNavbar/index.tsx index a092e9b..9ddcae5 100644 --- a/frontend/src/shared/components/TopNavbar/index.tsx +++ b/frontend/src/shared/components/TopNavbar/index.tsx @@ -7,6 +7,7 @@ import { RoleCode } from 'shared/generated/graphql'; import NOOP from 'shared/utils/noop'; import { useHistory } from 'react-router'; import { + NavbarLink, TaskcafeLogo, TaskcafeTitle, ProjectFinder, @@ -310,12 +311,12 @@ const NavBar: React.FC = ({ Projects - onDashboardClick()}> + - - onMyTasksClick()}> + + - +