1 | import React, {useContext, useState} from "react";
|
---|
2 | import { Link } from "react-router-dom";
|
---|
3 | import logo_icon from "../../../assets/logo_icon.png";
|
---|
4 | //import { AuthContext } from "../../../components/AuthContext/AuthContext";
|
---|
5 | import Logo from "../../../components/Logo/Logo.jsx";
|
---|
6 | import Profile from "../../../components/Profile/Profile.jsx";
|
---|
7 | import {useAppContext} from "../../../components/AppContext/AppContext.jsx";
|
---|
8 | import "./Navbar.css";
|
---|
9 |
|
---|
10 | function Navbar() {
|
---|
11 | const [click, setClick] = useState(false);
|
---|
12 | const [button, setButton] = useState(true);
|
---|
13 |
|
---|
14 | const handleClick = () => setClick(!click);
|
---|
15 | const closeMobileMenu = () => setClick(false);
|
---|
16 |
|
---|
17 | const { isAuthenticated } = useAppContext();
|
---|
18 |
|
---|
19 | return (
|
---|
20 | <nav className="modern-navbar">
|
---|
21 | <div className="navbar-container">
|
---|
22 | {/* Left Section - Logo and Title */}
|
---|
23 | <div className="navbar-left">
|
---|
24 | <Logo position="relative"/>
|
---|
25 | <h1 className="navbar-title">iMaps</h1>
|
---|
26 | </div>
|
---|
27 |
|
---|
28 | {/* Right Section - Login/Signup or Profile */}
|
---|
29 | <div className="navbar-right">
|
---|
30 | {isAuthenticated ? (
|
---|
31 | <Profile position="relative"/>
|
---|
32 | ) : (
|
---|
33 | <>
|
---|
34 | <Link to="/Login" className="navbar-btn navbar-login">
|
---|
35 | Log In
|
---|
36 | </Link>
|
---|
37 | <Link to="/Signup" className="navbar-btn navbar-signup">
|
---|
38 | Sign Up
|
---|
39 | </Link>
|
---|
40 | </>
|
---|
41 | )}
|
---|
42 | </div>
|
---|
43 | </div>
|
---|
44 | </nav>
|
---|
45 | );
|
---|
46 | }
|
---|
47 |
|
---|
48 | export default Navbar;
|
---|