Ignore:
Timestamp:
01/24/24 17:42:28 (5 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
0f5aa27
Parents:
5528b99
Message:

prefinal fixes

File:
1 edited

Legend:

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

    r5528b99 r07f4e8b  
    77import useGet from "../../Hooks/useGet";
    88import axios from "../../../axios.js";
    9 <<<<<<< HEAD
    109import {useAuth} from "../../Context/AuthContext";
    1110import ImageUpload from "../../ImageUpload/ImageUpload";
    12 =======
    13 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
    1411//import logo from 'assets/images/logo.png';
    1512//src="https://upload.wikimedia.org/wikipedia/commons/0/08/Vergina_Sun_-_Golden_Larnax.png"
     
    1714function Navigation(props) {
    1815  const navigator = useNavigate();
    19 <<<<<<< HEAD
    2016  const Auth = useAuth();
    2117  const isLoggedIn = Auth.userIsAuthenticated();
     
    2622  const handleShow = () => setShow(true);
    2723
    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)
    3324  return (
    3425    <>
     
    4031      >
    4132        <Container>
    42           <Navbar.Brand href="#home">
     33          <Navbar.Brand href="/home">
    4334            <span className="ikona">
    4435              <Image
     
    6657                <Button onClick={handleShow}></Button>
    6758              </Nav.Link>
    68               {!isLoading && !data && (
     59              {!isLoggedIn && (
    6960                <Button
    7061                  className="m-2"
     
    7869                </Button>
    7970              )}
    80               {!isLoading && data && (
     71              {isLoggedIn && (
    8172                <>
    8273                  <Nav.Link className="m-2" href="/profile">
    83                     {data}
     74                    {Auth.getUser().username}
    8475                  </Nav.Link>
    8576                  <Button
     
    9081                      await axios.get("/logout")
    9182                      .then((res) => {
    92                         console.log(res)
     83                        console.log(res);
     84                        Auth.userLogout();
    9385                      })
    9486                      .catch((err) => {
Note: See TracChangeset for help on using the changeset viewer.