Ignore:
Timestamp:
01/16/24 16:34:03 (6 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
07f4e8b
Parents:
e6c2521
Message:

revert

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Components/Layout/Navbar/Navigation.js

    re6c2521 r5528b99  
    77import useGet from "../../Hooks/useGet";
    88import axios from "../../../axios.js";
     9<<<<<<< HEAD
    910import {useAuth} from "../../Context/AuthContext";
    1011import ImageUpload from "../../ImageUpload/ImageUpload";
     12=======
     13>>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
    1114//import logo from 'assets/images/logo.png';
    1215//src="https://upload.wikimedia.org/wikipedia/commons/0/08/Vergina_Sun_-_Golden_Larnax.png"
     
    1417function Navigation(props) {
    1518  const navigator = useNavigate();
     19<<<<<<< HEAD
    1620  const Auth = useAuth();
    1721  const isLoggedIn = Auth.userIsAuthenticated();
     
    2226  const handleShow = () => setShow(true);
    2327
     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)
    2433  return (
    2534    <>
     
    3140      >
    3241        <Container>
    33           <Navbar.Brand href="/home">
     42          <Navbar.Brand href="#home">
    3443            <span className="ikona">
    3544              <Image
     
    5766                <Button onClick={handleShow}></Button>
    5867              </Nav.Link>
    59               {!isLoggedIn && (
     68              {!isLoading && !data && (
    6069                <Button
    6170                  className="m-2"
     
    6978                </Button>
    7079              )}
    71               {isLoggedIn && (
     80              {!isLoading && data && (
    7281                <>
    7382                  <Nav.Link className="m-2" href="/profile">
    74                     {Auth.getUser().username}
     83                    {data}
    7584                  </Nav.Link>
    7685                  <Button
     
    8190                      await axios.get("/logout")
    8291                      .then((res) => {
    83                         console.log(res);
    84                         Auth.userLogout();
     92                        console.log(res)
    8593                      })
    8694                      .catch((err) => {
Note: See TracChangeset for help on using the changeset viewer.