Skip to content

Commit f0ada94

Browse files
committed
Fix server-side aria-current
1 parent 7d5a60e commit f0ada94

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/navigation/Header.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const NavLink = ({ href, currentHref, children }: {
1515
children: ReactNode;
1616
}) => {
1717
const active = currentHref === href;
18-
1918
return (
2019
<Link
2120
className="text-lg font-bold py-2 border-y border-primary hover:border-primary-light aria-[current='page']:text-primary-dark aria-[current='page']:border-primary first-of-type:border-t-2 last-of-type:border-b-2 md:border-0 md:first-of-type:border-t-0 md:last-of-type:border-b-0"
@@ -42,10 +41,10 @@ const Header = ({ }: HeaderProps) => {
4241
<Bars3Icon className="w-6 h-6" />
4342
</Button>
4443
<div aria-expanded={open} className="absolute flex flex-col bg-fill gap-0 p-4 top-full inset-x-4 rounded-md shadow shadow-primary z-10 aria-[expanded='false']:hidden md:aria-[expanded='false']:flex md:flex-row md:items-center md:p-0 md:shadow-none md:static md:bg-transparent md:gap-12">
45-
<NavLink href="/" currentHref={router.asPath}>
44+
<NavLink href="/" currentHref={router.pathname}>
4645
Home
4746
</NavLink>
48-
<NavLink href="/about" currentHref={router.asPath}>
47+
<NavLink href="/about" currentHref={router.pathname}>
4948
About
5049
</NavLink>
5150
</div>

0 commit comments

Comments
 (0)