Skip to content

Commit

Permalink
Adjust usage of passHref on links
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Oct 23, 2024
1 parent 6cfb0d5 commit 12b8e4e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
4 changes: 3 additions & 1 deletion app/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function Header() {

return (
<header className="flex items-center justify-between border-b px-6 py-4 shadow-sm">
<Link href="/" className="flex items-center">
<Link href="/" className="flex items-center" passHref>
<Image src="/logo.png" alt="Logo" width={32} height={32} priority />
<span className="ml-2 text-xl font-bold">SurviveTheNight</span>
</Link>
Expand Down Expand Up @@ -89,6 +89,7 @@ export default function Header() {
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-2 text-sm"
passHref
>
Synced using Convex
<Image src="/convex.svg" alt="Convex" width={24} height={24} />
Expand All @@ -108,6 +109,7 @@ export default function Header() {
href="https://github.com/webdevcody/survive-the-night-sim"
rel="noopener noreferrer"
target="_blank"
passHref
>
<GitHubLogoIcon className="h-4 w-4" />
</Link>
Expand Down
2 changes: 1 addition & 1 deletion app/play/[level]/[attempt]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function PlayLevelAttemptPage({
<div className="container mx-auto flex min-h-screen flex-col items-center gap-8 py-12 pb-24">
<div className="flex w-full items-center justify-between">
<Button variant="outline" asChild className="flex items-center gap-2">
<Link href={`/play/${level}`}>
<Link href={`/play/${level}`} passHref>
<ChevronLeftIcon /> Back To Night #{level}
</Link>
</Button>
Expand Down
8 changes: 2 additions & 6 deletions app/play/[level]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ export default function PlayLevelPage({
</Link>
</Button>
<Button variant="outline" asChild className="flex items-center gap-2">
<Link href="/rules" passHref>
Rules
</Link>
<Link href="/rules">Rules</Link>
</Button>
{flags?.showTestPage && (
<Tabs
Expand Down Expand Up @@ -166,9 +164,7 @@ export default function PlayLevelPage({
</Link>
</Button>
<Button variant="outline" asChild className="flex items-center gap-2">
<Link href="/rules" passHref>
Rules
</Link>
<Link href="/rules">Rules</Link>
</Button>
{flags?.showTestPage && (
<Tabs
Expand Down
2 changes: 1 addition & 1 deletion app/prompts/[promptId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function EditPromptPage({
<h1 className="mb-4 font-semibold">Edit your prompt</h1>
<div className="flex space-x-4">
<Button variant="default">Save</Button>
<Link href="/prompts">
<Link href="/prompts" passHref>
<Button variant="default">Return</Button>
</Link>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/prompts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default function PromptsPage() {
<Link
href={`/prompts/${row._id}`}
className="flex items-center"
passHref
>
<Button variant="secondary">Edit</Button>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion components/PlayMapButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Button } from "./ui/button";
export function PlayMapButton({ mapId }: { mapId: string }) {
return (
<Button asChild variant="outline" size="icon">
<Link href={`/playground?map=${mapId}`}>
<Link href={`/playground?map=${mapId}`} passHref>
<ExternalLinkIcon size={16} />
</Link>
</Button>
Expand Down

0 comments on commit 12b8e4e

Please sign in to comment.