feat: error boundary page + aria-pressed on order configurator chips
- app/error.tsx: Next.js App Router error boundary matching mono design (500 graphic texture, "Try again" reset button, Home link) - bestall/page.tsx: Chip toggle buttons get aria-pressed attribute for screen-reader accessibility (markets, entity types, fields, enrichments) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -92,6 +92,7 @@ export default function ConfiguratorPage() {
|
||||
type="button"
|
||||
disabled={disabled}
|
||||
onClick={onClick}
|
||||
aria-pressed={active}
|
||||
className="border px-3 py-2 font-mono text-[11px] uppercase tracking-[0.08em] transition-colors disabled:cursor-not-allowed disabled:opacity-35"
|
||||
style={{
|
||||
borderColor: active ? "var(--foreground)" : "var(--border)",
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { useEffect } from "react";
|
||||
import { Header } from "@/components/header";
|
||||
|
||||
export default function Error({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
console.error(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<main id="main-content" className="min-h-screen bg-background text-foreground">
|
||||
<Header />
|
||||
<div className="mx-auto max-w-[80rem] px-6 py-28 md:py-40">
|
||||
<div className="relative">
|
||||
<span
|
||||
aria-hidden
|
||||
className="pointer-events-none absolute -top-8 right-0 select-none font-mono text-[clamp(6rem,22vw,18rem)] font-medium leading-none tracking-[-0.05em] text-foreground/[0.04]"
|
||||
>
|
||||
500
|
||||
</span>
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.18em] text-muted-foreground">
|
||||
Error
|
||||
</p>
|
||||
<h1 className="mt-5 max-w-[14ch] text-[clamp(2.6rem,7vw,5.5rem)] font-medium leading-[0.95] tracking-[-0.035em]">
|
||||
Something went wrong.
|
||||
</h1>
|
||||
<p className="mt-6 max-w-[40ch] font-mono text-sm text-muted-foreground">
|
||||
An unexpected error occurred. Nothing was guessed.{error.digest ? ` (${error.digest})` : ""}
|
||||
</p>
|
||||
<div className="mt-12 flex flex-wrap gap-3">
|
||||
<button
|
||||
onClick={reset}
|
||||
className="bg-foreground px-7 py-4 font-mono text-[12px] uppercase tracking-[0.14em] text-background transition-colors hover:bg-[var(--accent-red)]"
|
||||
>
|
||||
Try again →
|
||||
</button>
|
||||
<Link
|
||||
href="/"
|
||||
className="border border-foreground px-7 py-4 font-mono text-[12px] uppercase tracking-[0.14em] transition-colors hover:bg-foreground hover:text-background"
|
||||
>
|
||||
Home
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user