Update dependencies and use Vite instead of CRA

This commit is contained in:
Hazem Krimi
2023-03-25 01:26:03 +01:00
parent 20d74fe2ff
commit f31c6de4dc
63 changed files with 5300 additions and 13080 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
import { useReactiveVar } from '@apollo/client';
import { useHistory, useLocation } from 'react-router';
import { useNavigate, useLocation } from 'react-router';
import { roleVar, tokenVar, userVar } from '../../graphql/state';
import { Wrapper } from './styles';
import { Avatar, Link, Menu, Text } from '..';
@@ -8,7 +8,7 @@ import { Settings, Logout, Logo } from '../../assets';
const Navbar = () => {
const user = useReactiveVar(userVar);
const role = useReactiveVar(roleVar);
const history = useHistory();
const navigate = useNavigate();
const location = useLocation();
return (
@@ -151,7 +151,7 @@ const Navbar = () => {
{
icon: <Settings />,
label: 'Settings',
action: () => history.push('/settings'),
action: () => navigate('/settings'),
},
{
icon: <Logout />,
@@ -159,7 +159,7 @@ const Navbar = () => {
action: () => {
tokenVar(undefined);
localStorage.removeItem('token');
history.push('/login');
navigate('/login');
},
avoid: true,
},