Runs page in navbar
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
import Link, { LinkProps } from "next/link";
|
||||
import { forwardRef } from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
interface NavLinkCompatProps extends Omit<LinkProps, "className"> {
|
||||
className?: string;
|
||||
activeClassName?: string;
|
||||
pendingClassName?: string;
|
||||
}
|
||||
|
||||
const NavLink = forwardRef<HTMLAnchorElement, NavLinkCompatProps>(
|
||||
({ className, activeClassName, pendingClassName, href, ...props }, ref) => {
|
||||
const pathname = usePathname();
|
||||
const isActive = pathname === href;
|
||||
const isPending = false;
|
||||
|
||||
return (
|
||||
<Link
|
||||
ref={ref}
|
||||
href={href}
|
||||
className={cn(className, isActive && activeClassName, isPending && pendingClassName)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
NavLink.displayName = "NavLink";
|
||||
@@ -11,16 +11,16 @@ const navs = [
|
||||
icon: Zap,
|
||||
name: "Problems",
|
||||
},
|
||||
{
|
||||
link: "/run",
|
||||
icon: Timer,
|
||||
name: "Run",
|
||||
},
|
||||
{
|
||||
link: "/leaderboards",
|
||||
icon: Trophy,
|
||||
name: "Leaderboards",
|
||||
},
|
||||
{
|
||||
link: "/runs",
|
||||
icon: Timer,
|
||||
name: "Runs",
|
||||
},
|
||||
{
|
||||
link: "/profile",
|
||||
icon: User,
|
||||
|
||||
Reference in New Issue
Block a user