From 982ace4affbebdd29193f6686c93767e0140f18a Mon Sep 17 00:00:00 2001 From: AxelFTS <74424837+AxelFTS@users.noreply.github.com> Date: Thu, 18 Jan 2024 16:48:55 +0100 Subject: [PATCH] Delete src/components/Navbar.tsx --- src/components/Navbar.tsx | 73 --------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/components/Navbar.tsx diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx deleted file mode 100644 index 19c3800..0000000 --- a/src/components/Navbar.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { AppBar, Toolbar, Typography, Button, IconButton } from '@mui/material'; -import '../styles.css'; -import { makeStyles } from '@mui/styles'; -import React, { useContext } from 'react'; -import AuthContext from "@contexts/AuthContext"; -import { Link } from 'react-router-dom'; -import theme from '../theme'; -import { useTranslation } from "react-i18next"; -import LanguageSwitcher from './LanguageSwitcher'; -import useNightMode from '../hooks/backend/userService/useNightMode'; // Assurez-vous que le chemin d'accès est correct -import Brightness7Icon from '@mui/icons-material/Brightness7'; // icône de soleil -import Brightness4Icon from '@mui/icons-material/Brightness4'; // icône de lune - -const useStyles = makeStyles({ - title: { - flexGrow: 1, - }, - navButton: { - '&:hover': { - color: theme.palette.primary.main , - backgroundColor: 'white !important', - }, - }, -}); - - -const Navbar = () => { - const { isLoggedIn, logout } = useContext(AuthContext); - const { t } = useTranslation(); - const { isNightMode, toggleNightMode } = useNightMode(); - - const handleLogout = () => { - logout(); - }; - - const handleToggleNightMode = () => { - toggleNightMode().then(() => { - window.location.reload(); - }).catch(err => { - console.error('Error switching when switching night mode', err); - }); - }; - - const classes = useStyles(); - - return ( - - - - {t('navbar.dashboard')} - - - {isNightMode ? : } - - - {!isLoggedIn && ( - <> - - - )} - {isLoggedIn && ( - <> - - - - - )} - - - ); -}; - -export default Navbar;