From bbb1e1c18007b5ca5856590c55632f2ca6edf3b6 Mon Sep 17 00:00:00 2001 From: brain-marchine <152466993+brain-marchine@users.noreply.github.com> Date: Sun, 12 Jul 2026 16:55:27 +0800 Subject: [PATCH] feat: expose full navigation and ThemeToggle in header Fixes #6 --- src/components/Header.tsx | 112 +++++++++++++++++++++++++------------- src/lib/routes.ts | 12 ++++ 2 files changed, 85 insertions(+), 39 deletions(-) create mode 100644 src/lib/routes.ts diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 9d387b6..3ab682a 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,39 +1,73 @@ -import Link from "next/link"; - -const links = [ - { href: "/", label: "Home" }, - { href: "/pairs", label: "Pairs" }, - { href: "/quote", label: "Quote" }, - { href: "/stats", label: "Stats" }, - { href: "/admin", label: "Admin" }, -]; - -export function Header() { - return ( -
- -
- ); -} +"use client"; + +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { useState } from "react"; +import { ThemeToggle } from "@/components/ThemeToggle"; +import { ROUTES } from "@/lib/routes"; + +const navLinks = [ + ROUTES.home, + ROUTES.pairs, + ROUTES.quote, + ROUTES.stats, + ROUTES.admin, + ROUTES.events, + ROUTES.webhooks, + ROUTES.apiKeys, + ROUTES.settings, + ROUTES.docs, +]; + +export function Header() { + const pathname = usePathname(); + const [mobileOpen, setMobileOpen] = useState(false); + + return ( +
+
+ + StableRoute + +
+ + +
+
+ +
+ ); +} diff --git a/src/lib/routes.ts b/src/lib/routes.ts new file mode 100644 index 0000000..aed560b --- /dev/null +++ b/src/lib/routes.ts @@ -0,0 +1,12 @@ +export const ROUTES = { + home: { href: "/", title: "Home", description: "StableRoute dashboard landing page." }, + pairs: { href: "/pairs", title: "Pairs", description: "Manage registered routing pairs." }, + quote: { href: "/quote", title: "Quote", description: "Request routing quotes." }, + stats: { href: "/stats", title: "Stats", description: "View router metrics." }, + admin: { href: "/admin", title: "Admin", description: "Pause or resume the router." }, + events: { href: "/events", title: "Events", description: "Inspect router event log." }, + webhooks: { href: "/webhooks", title: "Webhooks", description: "Register webhook endpoints." }, + apiKeys: { href: "/api-keys", title: "API keys", description: "Manage operator API keys." }, + settings: { href: "/settings", title: "Settings", description: "Appearance and API configuration." }, + docs: { href: "/docs", title: "Docs", description: "HTTP API reference." }, +} as const;