Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Navbar Content #366

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 58 additions & 23 deletions src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect } from "react";
import { useState } from "react";
import { FaBars, FaTimes } from "react-icons/fa";
import { Nav, NavbarContainer, NavImg, NavMenu, NavItem, NavLinks, MobileIcon, NavLogo, SubLogo, Dropdown, DropdownContent, ButtonDropdown } from "./NavbarElements";
import { Link, useNavigate } from "react-router-dom";
Expand All @@ -10,8 +10,6 @@ import styled from "styled-components";

import ProgressBar from "./Progressbar";



const Button = styled.button`
padding: 5px 24px;
font-style: normal;
Expand Down Expand Up @@ -42,7 +40,7 @@ const Navbar = () => {
};

const handleLogoClick = () => {
setIsOpen(!isOpen);
setIsOpen(false);
window.scrollTo(0, 0);
};

Expand All @@ -64,16 +62,8 @@ const Navbar = () => {
};

return (
<>
<Nav
style={{
background: "#2B394A",
}}
>


<Nav>

<>
<Nav style={{ background: "#2B394A" }}>
<NavbarContainer>
<NavImg>
<Link to="/" onClick={handleLogoClick}>
Expand All @@ -90,20 +80,65 @@ const Navbar = () => {
</MobileIcon>

<NavMenu isOpen={isOpen}>


<NavItem>
<NavLinks to="/" onClick={handleLogoClick}>
Home
</NavLinks>
</NavItem>
<NavItem>
<NavLinks to="/#about" onClick={() => handleNavClick('/', 'about')}>
About
</NavLinks>
</NavItem>
<NavItem>
<NavLinks to="/#Features" onClick={() => handleNavClick('/', 'featureSection')}>
Features
</NavLinks>
</NavItem>
<NavItem>
<NavLinks to="/contact" onClick={handleLogoClick}>
Contact
</NavLinks>
</NavItem>
<NavItem>
<NavLinks to="/review" onClick={handleLogoClick}>
Review
</NavLinks>
</NavItem>
<NavItem>
<NavLinks to="/login" onClick={handleLogoClick} style={{ border: '1px solid rgb(48,175,91)' }}>
Log In
</NavLinks>
</NavItem>
{isAuthenticated && (
<NavItem>
<Dropdown>
<FontAwesomeIcon icon={faUser} style={{ color: '#fff' }} />
<ButtonDropdown onClick={toggleDropdown}>
Account
<FontAwesomeIcon icon={faCaretDown} style={{ color: '#fff' }} />
</ButtonDropdown>
{isOpen && (
<DropdownContent>
<Link to="/profile">User Profile</Link>
<Button
onClick={() =>
logout({ logoutParams: { returnTo: window.location.origin } })
}
>
Log Out
</Button>
</DropdownContent>
)}
</Dropdown>
</NavItem>
)}
</NavMenu>

</NavbarContainer>

</Nav>
<ProgressBar/>

</Nav>
<ProgressBar/>
</>
);
};


export default Navbar;