Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit cda87d3

Browse files
committed
add foundations and guides to footer and header
1 parent 1237444 commit cda87d3

File tree

3 files changed

+33
-11
lines changed

3 files changed

+33
-11
lines changed

src/components/Footer.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ function SmallPrint() {
7979
>
8080
Support
8181
</Link>
82+
<Link
83+
href={'/get-started/foundations/why-nitric'}
84+
className="text-xs text-zinc-600 hover:underline dark:text-zinc-400"
85+
>
86+
Foundations
87+
</Link>
88+
<Link
89+
href={'/guides'}
90+
className="text-xs text-zinc-600 hover:underline dark:text-zinc-400"
91+
>
92+
Guides
93+
</Link>
8294
</div>
8395
<div className="flex gap-4">
8496
<SocialLink href="https://x.com/nitric_io" icon={XIcon}>

src/components/layout/Header.tsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,26 @@ import { ThemeToggle } from '@/components/ThemeToggle'
1616
import { cn } from '@/lib/utils'
1717
import GitHubStarCount from '../GitHubStarCount'
1818
import { GitHubIcon } from '../icons/GitHubIcon'
19+
import { usePathname } from 'next/navigation'
1920

2021
function TopLevelNavItem({
2122
className,
23+
parentHref,
2224
...props
23-
}: ComponentPropsWithoutRef<typeof Link>) {
25+
}: ComponentPropsWithoutRef<typeof Link> & { parentHref?: string }) {
26+
const pathname = usePathname()
27+
28+
const isActive = parentHref
29+
? pathname.startsWith(parentHref)
30+
: pathname === props.href
31+
2432
return (
2533
<li>
2634
<Link
2735
{...props}
2836
className={cn(
2937
'text-sm font-semibold leading-5 text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white',
38+
isActive && 'text-zinc-900 dark:text-white',
3039
className,
3140
)}
3241
/>
@@ -73,25 +82,26 @@ export const Header = forwardRef<
7382
<Link href="/" aria-label="Home" className="hidden lg:block">
7483
<Logo className="h-6" />
7584
</Link>
76-
<div className="hidden lg:block">
77-
<Search />
78-
</div>
85+
7986
<div className="flex items-center gap-5 lg:hidden">
8087
<MobileNavigation />
8188
<Link href="/" aria-label="Home">
8289
<Logo className="h-6" />
8390
</Link>
8491
</div>
8592
<div className="flex items-center gap-5">
86-
<nav className="hidden md:block">
93+
<nav className="hidden lg:block">
8794
<ul role="list" className="flex items-center gap-8">
8895
<TopLevelNavItem
89-
href={'https://nitric.io'}
90-
target="_blank"
91-
rel="noreferrer noopener"
96+
parentHref="/get-started/foundations"
97+
href="/get-started/foundations/why-nitric"
9298
>
93-
Nitric.io
99+
Foundations
94100
</TopLevelNavItem>
101+
<TopLevelNavItem href="/guides">Guides</TopLevelNavItem>
102+
<li>
103+
<Search />
104+
</li>
95105

96106
<TopLevelNavItem
97107
className="group flex items-center"

src/components/layout/Search.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ export function Search() {
5858
<>
5959
<button
6060
type="button"
61-
className="lg:w-92 group hidden h-6 w-6 items-center justify-center sm:justify-start md:h-auto md:w-80 md:flex-none md:rounded-lg md:py-1 md:pl-4 md:pr-3.5 md:text-sm md:ring-1 md:ring-zinc-200 md:hover:ring-zinc-300 dark:md:bg-zinc-800/70 dark:md:ring-inset dark:md:ring-white/5 dark:md:hover:bg-zinc-700/40 dark:md:hover:ring-zinc-500 lg:flex"
61+
className="lg:w-92 group hidden h-6 w-6 items-center justify-center sm:justify-start md:h-auto md:w-52 md:flex-none md:rounded-lg md:py-1 md:pl-4 md:pr-3.5 md:text-sm md:ring-1 md:ring-zinc-200 md:hover:ring-zinc-300 dark:md:bg-zinc-800/70 dark:md:ring-inset dark:md:ring-white/5 dark:md:hover:bg-zinc-700/40 dark:md:hover:ring-zinc-500 lg:flex"
6262
onClick={onOpen}
6363
>
6464
<SearchIcon className="h-5 w-5 flex-none fill-zinc-400 group-hover:fill-zinc-500 dark:fill-zinc-500 md:group-hover:fill-zinc-400" />
6565
<span className="sr-only transition-colors dark:group-hover:text-white md:not-sr-only md:ml-2 md:text-zinc-500 md:dark:text-zinc-400">
66-
Search documentation
66+
Search
6767
</span>
6868
{modifierKey && (
6969
<kbd className="ml-auto hidden font-medium text-zinc-400 dark:text-zinc-500 md:block">

0 commit comments

Comments
 (0)