Skip to content

Commit

Permalink
fix: navbar links gradient (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xArdy authored Feb 13, 2023
1 parent 27629ac commit 5fd7b3a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/containers/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,31 @@ export const Navbar = ({}: NavbarProps) => {

const handleClick = (i: number) => {
setShowNavbar(!showNavbar);
const newNavLink = resetValues();
newNavLink[i].disabled = true;
setNavLink(newNavLink);
};

const resetValues = () => {
// reset values
const newNavLink = navLink.map((link) => ({
name: link.name,
url: link.url,
disabled: false,
}));

newNavLink[i].disabled = true;
setNavLink(newNavLink);
return newNavLink;
};

return (
<StyledNavbar id={showNavbar ? "show" : ""}>
<LogoContainer>
<WonderLogo to="/landing">
<WonderLogo
to="/landing"
onClick={() => {
setNavLink(resetValues());
}}
>
<img src={wonderLogo} alt="Wonderland logo" />
</WonderLogo>
<MenuButton onClick={() => setShowNavbar(!showNavbar)}>
Expand Down

0 comments on commit 5fd7b3a

Please sign in to comment.