Skip to content

Commit a383666

Browse files
Michael Borckclaude
andcommitted
perf: use next/link for internal navigation
Header, footer, first-run banner, and error-notice links now navigate client-side instead of full page reloads. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent bdf2362 commit a383666

4 files changed

Lines changed: 19 additions & 16 deletions

File tree

components/Chat.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ReactMarkdown from "react-markdown";
2+
import Link from "next/link";
23
import FinalInputArea from "./FinalInputArea";
34
import { useEffect, useRef, useState, useCallback } from "react";
45
import { strategies } from "@/utils/strategies";
@@ -34,12 +35,12 @@ function ChatErrorNotice({
3435
>
3536
Try again
3637
</button>
37-
<a
38+
<Link
3839
href="/settings"
3940
className="text-sm text-ink-muted underline transition-colors duration-normal hover:text-accent"
4041
>
4142
Check settings
42-
</a>
43+
</Link>
4344
</div>
4445
</div>
4546
);

components/Footer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ const Footer = () => {
55
return (
66
<div className="container flex min-h-[72px] flex-col items-center justify-between border-t border-hairline px-4 pb-3 pt-5 lg:min-h-[72px] lg:flex-row lg:px-0 lg:py-5">
77
<div className="flex w-full items-center justify-between">
8-
<a href="/" className="flex items-center gap-2">
8+
<Link href="/" className="flex items-center gap-2">
99
<span className="text-2xl">🎓</span>
1010
<span className="text-lg font-semibold text-ink">Study Buddy</span>
11-
</a>
11+
</Link>
1212
<div className="flex items-center gap-3">
1313
<Link href={"https://x.com/Michael_Borck"} target="_blank" title="Follow on X">
1414
<Image
@@ -52,12 +52,12 @@ const Footer = () => {
5252
</div>
5353
<p className="mt-2 text-xs text-ink-quiet lg:mt-0">
5454
Study Buddy &middot; part of the Buddy suite &middot;{" "}
55-
<a
55+
<Link
5656
href="/legal"
5757
className="underline transition-colors duration-normal hover:text-accent"
5858
>
5959
Legal
60-
</a>
60+
</Link>
6161
</p>
6262
</div>
6363
);

components/Header.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
1+
import Link from "next/link";
12
import packageJson from "../package.json";
23

34
const Header = () => {
45
return (
56
<div className="container flex h-[60px] shrink-0 items-center justify-between px-4 lg:h-[80px] lg:px-0">
6-
<a href="/" className="flex items-center gap-2">
7+
<Link href="/" className="flex items-center gap-2">
78
<span className="text-4xl">🎓</span>
89
<span className="text-xl font-semibold text-ink">Study Buddy</span>
910
<span className="text-xs text-ink-quiet">v{packageJson.version}</span>
10-
</a>
11+
</Link>
1112
<nav className="flex items-center space-x-6">
12-
<a
13+
<Link
1314
href="/docs"
1415
className="text-ink-muted transition-colors duration-normal hover:text-ink"
1516
style={{ fontWeight: 500 }}
1617
>
1718
Docs
18-
</a>
19-
<a
19+
</Link>
20+
<Link
2021
href="/about"
2122
className="text-ink-muted transition-colors duration-normal hover:text-ink"
2223
style={{ fontWeight: 500 }}
2324
>
2425
About
25-
</a>
26-
<a
26+
</Link>
27+
<Link
2728
href="/settings"
2829
className="text-ink-muted transition-colors duration-normal hover:text-ink"
2930
style={{ fontWeight: 500 }}
3031
>
3132
Settings
32-
</a>
33+
</Link>
3334
</nav>
3435
</div>
3536
);

components/Hero.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Image from "next/image";
2+
import Link from "next/link";
23
import { FC, useState, useEffect } from "react";
34
import InitialInputArea from "./InitialInputArea";
45
import { suggestions } from "@/utils/utils";
@@ -78,12 +79,12 @@ const Hero: FC<THeroProps> = ({
7879
Set up Ollama (free)
7980
</a>{" "}
8081
or go to{" "}
81-
<a
82+
<Link
8283
href="/settings"
8384
className="font-medium text-ink underline transition-colors duration-normal hover:text-accent"
8485
>
8586
Settings
86-
</a>{" "}
87+
</Link>{" "}
8788
to add a cloud provider.
8889
</p>
8990
<button

0 commit comments

Comments
 (0)