From 64dda16493964aec60fbbfc74f06999d1df0e89c Mon Sep 17 00:00:00 2001 From: Simon Axelsson Date: Thu, 25 Jun 2026 17:54:23 +0200 Subject: [PATCH] fix: aria-current on active nav links and stepper step - header: mark active page with aria-current="page" + highlight underline - portal-shell sidebar: aria-current="page" on active nav link - order-stepper: aria-current="step" on the active step Co-Authored-By: Claude Sonnet 4.6 --- components/header.tsx | 27 +++++++++++++++++---------- components/order-stepper.tsx | 1 + components/portal-shell.tsx | 1 + 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/components/header.tsx b/components/header.tsx index 7e7b3a9..65831b2 100644 --- a/components/header.tsx +++ b/components/header.tsx @@ -3,6 +3,7 @@ import Link from "next/link"; import { useEffect, useState } from "react"; import { useTheme } from "next-themes"; +import { usePathname } from "next/navigation"; import { useT } from "@/components/locale-provider"; import { LocaleSwitcher } from "@/components/locale-switcher"; @@ -47,6 +48,7 @@ function ThemeToggle() { export function Header() { const t = useT(); + const pathname = usePathname(); const [scrolled, setScrolled] = useState(false); const [open, setOpen] = useState(false); @@ -69,16 +71,21 @@ export function Header() {
diff --git a/components/order-stepper.tsx b/components/order-stepper.tsx index 0532f66..7d8b230 100644 --- a/components/order-stepper.tsx +++ b/components/order-stepper.tsx @@ -45,6 +45,7 @@ export function OrderStepper({ active }: { active: 1 | 2 | 3 | 4 }) {
{s.href && (isDone || isActive) ? ( diff --git a/components/portal-shell.tsx b/components/portal-shell.tsx index d2eeef7..02cfe95 100644 --- a/components/portal-shell.tsx +++ b/components/portal-shell.tsx @@ -86,6 +86,7 @@ export function PortalShell({