* initial change * nav highlighting * icon change * deeeedoooop * text * show version number on all pages * icon * remove unused code * add knip * formatting * remove unused code * types fix * remove notion completely from the codebase. * update test for new url structure * clean up the fucking shop boys * make a "create job" factory and use that * moar factories * formatting
38 lines
861 B
TypeScript
38 lines
861 B
TypeScript
import { Home, LayoutDashboard, Settings, Shield } from "lucide-react";
|
|
|
|
export type NavLink = {
|
|
to: string;
|
|
label: string;
|
|
icon: typeof Home;
|
|
activePaths?: string[];
|
|
};
|
|
|
|
export const NAV_LINKS: NavLink[] = [
|
|
{ to: "/overview", label: "Overview", icon: Home },
|
|
{
|
|
to: "/jobs/ready",
|
|
label: "Jobs",
|
|
icon: LayoutDashboard,
|
|
activePaths: [
|
|
"/jobs/ready",
|
|
"/jobs/discovered",
|
|
"/jobs/applied",
|
|
"/jobs/all",
|
|
],
|
|
},
|
|
{ to: "/visa-sponsors", label: "Visa Sponsors", icon: Shield },
|
|
{ to: "/settings", label: "Settings", icon: Settings },
|
|
];
|
|
|
|
export const isNavActive = (
|
|
pathname: string,
|
|
to: string,
|
|
activePaths?: string[],
|
|
) => {
|
|
if (pathname === to) return true;
|
|
if (!activePaths) return false;
|
|
return activePaths.some(
|
|
(path) => pathname === path || pathname.startsWith(`${path}/`),
|
|
);
|
|
};
|