refactor: change nav icons to use Link instead of history.push

This commit is contained in:
Jordan Knott 2021-01-05 19:10:07 -06:00
parent f9e6fba552
commit dc50ef3566
2 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -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<NavBarProps> = ({
<ProjectFinder onClick={onOpenProjectFinder} variant="gradient">
Projects
</ProjectFinder>
<IconContainer onClick={() => onDashboardClick()}>
<NavbarLink to="">
<HomeDashboard width={20} height={20} />
</IconContainer>
<IconContainer onClick={() => onMyTasksClick()}>
</NavbarLink>
<NavbarLink to="/tasks">
<CheckCircle width={20} height={20} />
</IconContainer>
</NavbarLink>
<IconContainer disabled onClick={NOOP}>
<ListUnordered width={20} height={20} />
</IconContainer>