Skip to content

Commit 11a399a

Browse files
committed
refactor: TenYearHero to server component
1 parent fbf266c commit 11a399a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/[locale]/10years/_components/TenYearHero.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
"use client"
1+
import { getTranslations } from "next-intl/server"
22

33
import { Image } from "@/components/Image"
44
import ParallaxImage from "@/components/Image/ParallaxImage"
55
import Morpher from "@/components/Morpher"
66

7-
import { useTranslation } from "@/hooks/useTranslation"
87
import TenYearBackgroundImage from "@/public/images/10-year-anniversary/10-year-background.png"
98
import TenYearGraphicImage from "@/public/images/10-year-anniversary/10-year-graphic.png"
109

11-
const TenYearHero = () => {
12-
const { t } = useTranslation("page-10-year-anniversary")
10+
const TenYearHero = async ({ locale }: { locale: string }) => {
11+
const t = await getTranslations({
12+
locale,
13+
namespace: "page-10-year-anniversary",
14+
})
1315

1416
const WORDS = [
1517
t("page-10-year-censorship-resistance"),

app/[locale]/10years/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
7777
return (
7878
<I18nProvider locale={locale} messages={messages}>
7979
<MainArticle className="mx-auto flex w-full flex-col items-center">
80-
<TenYearHero />
80+
<TenYearHero locale={locale} />
8181

8282
<div className="mt-16 flex w-full flex-col gap-16 px-8 py-4 md:flex-row md:py-8">
8383
<div className="flex flex-1 flex-col gap-5">

0 commit comments

Comments
 (0)