From 9e46aeee594977f5ba90efccd848dfa830fd58eb Mon Sep 17 00:00:00 2001
From: Alberto Defendi <1369-ahl-berto@users.noreply.gitlab.inf.unibz.it>
Date: Sun, 23 May 2021 17:27:56 +0200
Subject: [PATCH] Merge @fmazzini Navbar.

---
 .../AuthUser/Dashboard/HomePage/NavBarLogin.tsx     | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/components/AuthUser/Dashboard/HomePage/NavBarLogin.tsx b/src/components/AuthUser/Dashboard/HomePage/NavBarLogin.tsx
index 92d0045..b81244d 100644
--- a/src/components/AuthUser/Dashboard/HomePage/NavBarLogin.tsx
+++ b/src/components/AuthUser/Dashboard/HomePage/NavBarLogin.tsx
@@ -3,6 +3,9 @@ import { makeStyles } from '@material-ui/core/styles';
 import { Tabs, Tab } from '@material-ui/core';
 import LockIcon from '@material-ui/icons/Lock';
 
+import { Link, useHistory } from 'react-router-dom';
+import { NonAuthRoutes } from 'api/routes';
+
 const useStyles = makeStyles(() => ({
   tabs: {
     color: 'white',
@@ -26,15 +29,19 @@ const useStyles = makeStyles(() => ({
 }));
 
 export const NavBarLogin: FC = () => {
+  const history = useHistory();
+
   const classes = useStyles();
 
-  const [value, setValue] = React.useState(0);
+  const [value, setValue] = React.useState('');
 
   const handleChange = (
     event: React.ChangeEvent<unknown>,
-    newValue: number,
+    newValue: string,
   ): void => {
     setValue(newValue);
+    history.replace(newValue);
+    console.log(newValue);
   };
 
   return (
@@ -45,8 +52,8 @@ export const NavBarLogin: FC = () => {
       className={classes.tabs}
       TabIndicatorProps={{ style: { display: 'none' } }}
     >
-      <Tab label="" className={classes.tabPan} />
       <Tab
+        value={`/auth${NonAuthRoutes.signIn}`}
         label="Login"
         icon={<LockIcon className={classes.tabIcon} />}
         className={`${classes.tabPan} ${classes.rightAlign}`}
-- 
GitLab