Skip to content

Commit 346c4ab

Browse files
authored
Merge branch 'main' into docs/mcp-server-fx
2 parents aac56d9 + 6d235da commit 346c4ab

5 files changed

Lines changed: 35 additions & 9 deletions

File tree

apps/site/src/components/footer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link from "next/link";
22
import { Github, Linkedin, Mail, XSocial } from "@/components/icons/forma";
33
import { AnimatedWordmark } from "@/components/brand/animated-wordmark";
4+
import { SiteLink } from "@/components/site-link";
45
import { siteConfig } from "@/lib/config";
56

67
// Light reference-style footer (Fincrest): brand block with contact + social
@@ -62,12 +63,12 @@ export function Footer() {
6263
<ul className="space-y-3">
6364
{items.map((item) => (
6465
<li key={item.href}>
65-
<Link
66+
<SiteLink
6667
href={item.href}
6768
className="text-sm text-muted-foreground transition-colors hover:text-foreground"
6869
>
6970
{item.label}
70-
</Link>
71+
</SiteLink>
7172
</li>
7273
))}
7374
</ul>

apps/site/src/components/header.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
} from "@/components/ui/navigation-menu";
1616
import { Sheet, SheetContent, SheetTitle, SheetTrigger } from "@/components/ui/sheet";
1717
import { Logo } from "@/components/logo";
18+
import { SiteLink } from "@/components/site-link";
1819
import { siteConfig } from "@/lib/config";
1920
import { cn } from "@/lib/utils";
2021
import { trackCTA } from "@prisma-docs/ui/lib/analytics";
@@ -105,13 +106,13 @@ export function Header() {
105106
</NavigationMenuList>
106107
</NavigationMenu>
107108
{siteConfig.nav.map((item) => (
108-
<Link
109+
<SiteLink
109110
key={item.href}
110111
href={item.href}
111112
className="text-sm font-medium text-muted-foreground transition-colors hover:text-foreground"
112113
>
113114
{item.label}
114-
</Link>
115+
</SiteLink>
115116
))}
116117
</nav>
117118

@@ -172,14 +173,14 @@ export function Header() {
172173
))}
173174
<div className="border-t pt-4 flex flex-col gap-4">
174175
{siteConfig.nav.map((item) => (
175-
<Link
176+
<SiteLink
176177
key={item.href}
177178
href={item.href}
178179
className="text-lg font-medium"
179180
onClick={() => setOpen(false)}
180181
>
181182
{item.label}
182-
</Link>
183+
</SiteLink>
183184
))}
184185
</div>
185186
<div className="flex flex-col gap-2 mt-4 pt-4 border-t">
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Link from "next/link";
2+
import { isCrossZoneHref } from "@/lib/zones";
3+
4+
// Drop-in for next/link in nav/footer maps whose hrefs may point at another
5+
// zone (/docs, /blog): those render as a plain <a> so the browser
6+
// hard-navigates; everything else keeps client-side routing.
7+
export function SiteLink({ href, ...props }: React.ComponentProps<"a"> & { href: string }) {
8+
if (isCrossZoneHref(href)) {
9+
return <a href={href} {...props} />;
10+
}
11+
return <Link href={href} {...props} />;
12+
}

apps/site/src/components/utm-persistence.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
import { UtmPersistence as SharedUtmPersistence } from "@prisma-docs/ui/components/utm-persistence";
44
import { UTM_ATTRIBUTION_STORAGE_KEY } from "@prisma-docs/ui/lib/utm";
5-
6-
const PROXIED_PATHS = ["/docs", "/blog"];
5+
import { CROSS_ZONE_PATHS } from "@/lib/zones";
76

87
export function UtmPersistence() {
98
return (
10-
<SharedUtmPersistence storageKey={UTM_ATTRIBUTION_STORAGE_KEY} proxiedPaths={PROXIED_PATHS} />
9+
<SharedUtmPersistence
10+
storageKey={UTM_ATTRIBUTION_STORAGE_KEY}
11+
proxiedPaths={CROSS_ZONE_PATHS}
12+
/>
1113
);
1214
}

apps/site/src/lib/zones.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Paths served by other Next.js apps through the multi-zone rewrites in
2+
// next.config.mjs (DOCS_ORIGIN / BLOG_ORIGIN). Links to these must hard-navigate
3+
// with a plain <a>: next/link soft-navigation fetches the other zone's RSC
4+
// payload, which this app's router cannot apply, and the click silently does
5+
// nothing.
6+
export const CROSS_ZONE_PATHS = ["/docs", "/blog"];
7+
8+
export function isCrossZoneHref(href: string): boolean {
9+
return CROSS_ZONE_PATHS.some((path) => href === path || href.startsWith(`${path}/`));
10+
}

0 commit comments

Comments
 (0)