Skip to content

Commit

Permalink
fix: fixed navbar "All Tools" not navigating to tools page
Browse files Browse the repository at this point in the history
Refactor Navbar component and add Link component for navigation
  • Loading branch information
a0v0 authored Apr 30, 2024
2 parents 977d74f + e3bc1ce commit 7144204
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
26 changes: 3 additions & 23 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,6 @@ export const Navbar: FC<NavbarProps> = ({routes, slug, tag}) => {
return null;
}

const handlePressNavbarItem = (name: string, url: string) => {
trackEvent("NavbarItem", {
name,
action: "press",
category: "navbar",
data: url,
});
};

return (
<NextUINavbar
ref={ref}
Expand Down Expand Up @@ -127,14 +118,9 @@ export const Navbar: FC<NavbarProps> = ({routes, slug, tag}) => {
</NavbarContent>
<NavbarContent className="hidden sm:flex gap-4" justify="start">
<NavbarItem>
<Button
className="p-0 bg-transparent data-[hover=true]:bg-transparent"
href="/tools"
radius="sm"
variant="light"
>
<Link isBlock color="foreground" href={"/tools"}>
All Tools
</Button>
</Link>
</NavbarItem>
{manifest.routes.map((category, index) =>
category.routes.length > 0 ? (
Expand Down Expand Up @@ -172,13 +158,7 @@ export const Navbar: FC<NavbarProps> = ({routes, slug, tag}) => {
<NavbarContent className="flex w-full gap-2 sm:hidden" justify="end">
<NavbarItem className="flex h-full items-center">
<ThemeSwitch />
<Link
isExternal
aria-label="Github"
className="p-1"
href={siteConfig.links.github}
onPress={() => handlePressNavbarItem("Github", siteConfig.links.github)}
>
<Link isExternal aria-label="Github" className="p-1" href={siteConfig.links.github}>
<GithubIcon className="text-default-600 dark:text-default-500" />
</Link>
</NavbarItem>
Expand Down
6 changes: 3 additions & 3 deletions components/hero.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";
import {Button, Link} from "@nextui-org/react";
import {Button} from "@nextui-org/react";
import {ArrowRightIcon} from "@nextui-org/shared-icons";
import Link from "next/link";
import {Logo} from "./icons";
import {subtitle, title} from "./primitives";

function HeroX() {
return (
<section className="flex flex-col gap-4 overflow-hidden lg:overflow-visible w-full flex-nowrap justify-between items-center h-[calc(100vh_-_64px)] 2xl:h-[calc(84vh_-_64px)]">
<div></div>
<div className="inline-block text-center justify-center">
<center>
<Logo />
Expand All @@ -22,7 +22,7 @@ function HeroX() {
})}
>
Fast, beautiful and modern tools for everyone.
</h2>{" "}
</h2>
<Button
as={Link}
endContent={<ArrowRightIcon />}
Expand Down

0 comments on commit 7144204

Please sign in to comment.