mirror of
https://github.com/Such-Software/wowcheckout.git
synced 2026-10-17 05:51:45 +02:00
Minimal changes from upstream xmrcheckout to support Wownero: - Rate provider: Nonlogs WOW-BTC via Kraken BTC/USD - Subaddress derivation: Wownero network byte overrides (53/63/54) - Payment URI scheme: wownero: - Dockerfile: Wownero binaries from Codeberg - Display text: Monero→Wownero, XMR→WOW throughout UI - Default daemon: 192.168.88.235:34568 - Added wownero-logo.svg File and folder structure kept identical to upstream for easy sync.
48 lines
922 B
TypeScript
48 lines
922 B
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { usePathname } from "next/navigation";
|
|
|
|
function normalizePath(path: string) {
|
|
if (!path.startsWith("/")) {
|
|
return `/${path}`;
|
|
}
|
|
|
|
if (path === "/") {
|
|
return "/";
|
|
}
|
|
|
|
return path.replace(/\/+$/, "");
|
|
}
|
|
|
|
export default function NavLink({
|
|
href,
|
|
children,
|
|
className,
|
|
exact,
|
|
}: {
|
|
href: string;
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
exact?: boolean;
|
|
}) {
|
|
const pathname = usePathname() ?? "/";
|
|
const currentPath = normalizePath(pathname);
|
|
const targetPath = normalizePath(href);
|
|
|
|
const isActive = exact
|
|
? currentPath === targetPath
|
|
: currentPath === targetPath || currentPath.startsWith(`${targetPath}/`);
|
|
|
|
return (
|
|
<Link
|
|
href={href}
|
|
className={className}
|
|
aria-current={isActive ? "page" : undefined}
|
|
data-active={isActive ? "true" : undefined}
|
|
>
|
|
{children}
|
|
</Link>
|
|
);
|
|
}
|