Changeset 07f4e8b for frontend/src/Components/Layout/Navbar
- Timestamp:
- 01/24/24 17:42:28 (10 months ago)
- Branches:
- master
- Children:
- 0f5aa27
- Parents:
- 5528b99
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/Layout/Navbar/Navigation.js
r5528b99 r07f4e8b 7 7 import useGet from "../../Hooks/useGet"; 8 8 import axios from "../../../axios.js"; 9 <<<<<<< HEAD10 9 import {useAuth} from "../../Context/AuthContext"; 11 10 import ImageUpload from "../../ImageUpload/ImageUpload"; 12 =======13 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)14 11 //import logo from 'assets/images/logo.png'; 15 12 //src="https://upload.wikimedia.org/wikipedia/commons/0/08/Vergina_Sun_-_Golden_Larnax.png" … … 17 14 function Navigation(props) { 18 15 const navigator = useNavigate(); 19 <<<<<<< HEAD20 16 const Auth = useAuth(); 21 17 const isLoggedIn = Auth.userIsAuthenticated(); … … 26 22 const handleShow = () => setShow(true); 27 23 28 =======29 30 const { data, setData, isLoading, getData } = useGet("/username");31 32 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)33 24 return ( 34 25 <> … … 40 31 > 41 32 <Container> 42 <Navbar.Brand href=" #home">33 <Navbar.Brand href="/home"> 43 34 <span className="ikona"> 44 35 <Image … … 66 57 <Button onClick={handleShow}></Button> 67 58 </Nav.Link> 68 {!isLo ading && !data&& (59 {!isLoggedIn && ( 69 60 <Button 70 61 className="m-2" … … 78 69 </Button> 79 70 )} 80 { !isLoading && data&& (71 {isLoggedIn && ( 81 72 <> 82 73 <Nav.Link className="m-2" href="/profile"> 83 { data}74 {Auth.getUser().username} 84 75 </Nav.Link> 85 76 <Button … … 90 81 await axios.get("/logout") 91 82 .then((res) => { 92 console.log(res) 83 console.log(res); 84 Auth.userLogout(); 93 85 }) 94 86 .catch((err) => {
Note:
See TracChangeset
for help on using the changeset viewer.