Skip to content

Commit

Permalink
removed duplicate h1 + added aria-current
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Oct 24, 2023
1 parent 8e1d6cd commit 848322e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/website/components/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type MenuProps = JSX.IntrinsicElements["nav"] & {
const Menu = ({ className, items, prefix, ...props }: MenuProps) => (
<nav
{...props}
aria-label="Main navigation"
className={cx(
"prose prose-sm prose-ul:list-none prose-a:no-underline p-4",
className
Expand Down
1 change: 1 addition & 0 deletions packages/website/components/NavLink/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const NavLink = ({
<Link
{...props}
href={href}
aria-current={isActive ? "page" : undefined}
className={cx(className, isActive ? activeClassName : "")}
/>
);
Expand Down
11 changes: 8 additions & 3 deletions packages/website/components/layouts/Documentation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ import Link from "next/link";
import cx from "utils/cx";

const renderTopLink = (className: string, productName: string) => (
<h1 className={cx("flex gap-2 font-medium", className)}>
<nav aria-label="Breadcrumb" className={cx("font-medium", className)}>
<Link href="/" className="underline">
af-utils
</Link>
/<span className="text-slate-500">{productName}</span>
</h1>
<span className="px-2" aria-hidden="true">
/
</span>
<span className="text-slate-500" aria-current="page">
{productName}
</span>
</nav>
);

const getDocumentationLayout =
Expand Down

0 comments on commit 848322e

Please sign in to comment.