Changeset ac19a0c for frontend/src/Components/Layout/Navbar
- Timestamp:
- 01/13/24 23:19:50 (10 months ago)
- Branches:
- master
- Children:
- e85a562
- Parents:
- e9b4ba9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/Layout/Navbar/Navigation.js
re9b4ba9 rac19a0c 7 7 import useGet from "../../Hooks/useGet"; 8 8 import axios from "../../../axios.js"; 9 import {useAuth} from "../../Context/AuthContext"; 9 10 //import logo from 'assets/images/logo.png'; 10 11 //src="https://upload.wikimedia.org/wikipedia/commons/0/08/Vergina_Sun_-_Golden_Larnax.png" … … 12 13 function Navigation(props) { 13 14 const navigator = useNavigate(); 14 15 const { data, setData, isLoading, getData } = useGet("/username"); 16 15 const Auth = useAuth(); 16 const isLoggedIn = Auth.userIsAuthenticated(); 17 17 return ( 18 18 <> … … 24 24 > 25 25 <Container> 26 <Navbar.Brand href=" #home">26 <Navbar.Brand href="/home"> 27 27 <span className="ikona"> 28 28 <Image … … 50 50 Pricing 51 51 </Nav.Link> 52 {!isLo ading && !data&& (52 {!isLoggedIn && ( 53 53 <Button 54 54 className="m-2" … … 62 62 </Button> 63 63 )} 64 { !isLoading && data&& (64 {isLoggedIn && ( 65 65 <> 66 66 <Nav.Link className="m-2" href="/profile"> 67 { data}67 {Auth.getUser().username} 68 68 </Nav.Link> 69 69 <Button … … 74 74 await axios.get("/logout") 75 75 .then((res) => { 76 console.log(res) 76 console.log(res); 77 Auth.userLogout(); 77 78 }) 78 79 .catch((err) => {
Note:
See TracChangeset
for help on using the changeset viewer.