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