Skip to content

Commit 80104fd

Browse files
committed
Fix a circular
1 parent 9d50d65 commit 80104fd

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/components/navbar/nav-link.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import clsx from "clsx"
44
import type * as normalizePages from "nextra/normalize-pages"
55
import React from "react"
66
import { Anchor } from "../../app/conf/_design-system/anchor"
7-
import { linkClasses } from "./navbar"
87
import { usePathname } from "next/navigation"
98

9+
export const navLinkClasses =
10+
"typography-menu flex items-center text-neu-900 px-3 py-1 nextra-focus [text-box:trim-both_cap_alphabetic] leading-none hover:underline underline-offset-2"
11+
1012
export interface NavLinkProps {
1113
href: string
1214
isActive: boolean
@@ -29,7 +31,7 @@ export function NavLink({
2931
<Anchor
3032
href={href}
3133
className={clsx(
32-
linkClasses,
34+
navLinkClasses,
3335
"whitespace-nowrap max-md:hidden",
3436
isActive && !page.newWindow && "underline",
3537
)}

src/components/navbar/navbar.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@ import CloseIcon from "@/app/conf/_design-system/pixelarticons/close.svg?svgr"
1616
import { GraphQLWordmarkLogo } from "../../icons"
1717
import { ThemeSwitch } from "../theme-switch"
1818
import { Flexsearch } from "../flexsearch"
19-
import { NavLink } from "./nav-link"
19+
import { NavLink, navLinkClasses } from "./nav-link"
2020

2121
type Item = normalizePages.PageItem | normalizePages.MenuItem
2222
export interface NavBarProps {
2323
items: Item[]
2424
}
2525

26-
export const linkClasses =
27-
"typography-menu flex items-center text-neu-900 px-3 py-1 nextra-focus [text-box:trim-both_cap_alphabetic] leading-none hover:underline underline-offset-2"
28-
2926
function NavbarMenu({
3027
menu,
3128
children,
@@ -40,7 +37,7 @@ function NavbarMenu({
4037
<NavigationMenu.Item className="max-md:hidden">
4138
<NavigationMenu.Trigger
4239
className={clsx(
43-
linkClasses,
40+
navLinkClasses,
4441
"focus-visible:nextra-focusable flex items-center gap-1.5 whitespace-nowrap data-[popup-open]:underline max-md:hidden",
4542
)}
4643
>

0 commit comments

Comments
 (0)