Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions zubhub_frontend/zubhub/src/components/Sidenav/Sidenav.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
CircularProgress,
Link,
List,
ListItem,
ListItemIcon,
Expand All @@ -12,7 +11,7 @@ import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import { useHistory, useLocation } from 'react-router-dom';
import { useHistory, useLocation, Link } from 'react-router-dom';
import API from '../../api';
import { images } from '../../assets/images';
import { logout } from '../../store/actions/authActions';
Expand Down Expand Up @@ -67,7 +66,7 @@ export default function Sidenav() {
<div className={classes.container}>
<List className={classes.listContainer}>
{isSmallScreen && (
<Link className={clsx(classes.logo, classes.link)} href="/">
<Link className={clsx(classes.logo, classes.link)} to="/">
<ListItem>
<img alt="Zubhub Logo" src={images.logo} />
</ListItem>
Expand All @@ -82,7 +81,7 @@ export default function Sidenav() {
<Link
key={index + label}
className={clsx(classes.label, classes.link, pathname === link && classes.active, red && classes.red)}
href={link}
to={link}
target={target || '_self'}
>
<ListItem key={label}>
Expand Down Expand Up @@ -114,7 +113,7 @@ export default function Sidenav() {
<Link
key={index + label}
className={clsx(classes.label, classes.link, pathname == link && classes.active, red && classes.red)}
href={link}
to={link}
target={target || '_self'}
>
<ListItem key={label}>
Expand All @@ -138,7 +137,7 @@ export default function Sidenav() {
key={index + label}
className={clsx(classes.label, classes.link, pathname == link && classes.active, red && classes.red)}
style={{ marginTop: index == 0 && 'auto' }}
{...(link && { href: link })}
{...(link && { to: link })}
onClick={action == 'logout' ? handleLogout : null}
>
<ListItem key={label}>
Expand Down