refactor: change nav icons to use Link instead of history.push
This commit is contained in:
parent
f9e6fba552
commit
dc50ef3566
@ -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;
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user