Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♻️ Use locale-aware link for hero announcement (#3139)

Luke Vella345a739ac1d2
diff --git a/apps/landing/src/components/home/hero.tsx b/apps/landing/src/components/home/hero.tsx
index d25d5470f..caad65262 100644
--- a/apps/landing/src/components/home/hero.tsx
+++ b/apps/landing/src/components/home/hero.tsx
@@ -1,7 +1,7 @@
import { Badge } from "@rallly/ui/badge";
import { ArrowRightIcon } from "lucide-react";
-import Link from "next/link";
import type * as React from "react";
+import { LinkBase } from "@/i18n/client/link";
export function HeroAnnouncement({
href,
@@ -13,7 +13,7 @@ export function HeroAnnouncement({
children: React.ReactNode;
}) {
return (
- <Link
+ <LinkBase
href={href}
prefetch={false}
className="group -ml-1 inline-flex max-w-full items-center gap-x-2 rounded-full bg-gray-200/50 p-1 pr-3 text-sm transition-all hover:bg-gray-200"
@@ -26,7 +26,7 @@ export function HeroAnnouncement({
className="size-3 shrink-0 text-gray-500 transition-transform group-hover:translate-x-0.5 group-active:translate-x-0.5"
aria-hidden="true"
/>
- </Link>
+ </LinkBase>
);
}
diff --git a/apps/landing/src/i18n/client/link.tsx b/apps/landing/src/i18n/client/link.tsx
index 035b39b51..fff6597d9 100644
--- a/apps/landing/src/i18n/client/link.tsx
+++ b/apps/landing/src/i18n/client/link.tsx
@@ -8,10 +8,12 @@ export const LinkBase = ({
href,
children,
className,
+ prefetch,
}: {
href: string;
children?: React.ReactNode;
className?: string;
+ prefetch?: boolean;
}) => {
const { i18n } = useTranslation();
const locale =
@@ -19,7 +21,7 @@ export const LinkBase = ({
const newHref = href.startsWith("/") ? `${locale}${href}` : href;
return (
- <Link className={className} href={newHref}>
+ <Link className={className} href={newHref} prefetch={prefetch}>
{children}
</Link>
);