From 12699689a880109db9a932c83e4c0e66c6eb7d9b Mon Sep 17 00:00:00 2001 From: Supattra Wongsamal Date: Sun, 10 Nov 2024 15:50:17 +0100 Subject: [PATCH] feat: change to async, use getTranslations intead of useTranslations --- src/app/[locale]/(default)/about/page.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/[locale]/(default)/about/page.tsx b/src/app/[locale]/(default)/about/page.tsx index bfd85b2..f6b1673 100644 --- a/src/app/[locale]/(default)/about/page.tsx +++ b/src/app/[locale]/(default)/about/page.tsx @@ -1,7 +1,6 @@ -import { unstable_setRequestLocale } from 'next-intl/server'; +import { getTranslations } from 'next-intl/server'; import React from 'react'; import { Card, CardContent, CardHeader } from 'src/components/ui/Card'; -import { useTranslations } from 'next-intl'; import { Printer, Gamepad2, SquareUserRound } from 'lucide-react'; import { Meteors } from '@/components/ui/Meteor'; import { FAQAccordion } from '@/components/about/FAQAccordion'; @@ -13,9 +12,9 @@ export default async function AboutPage({ }: { params: Promise<{ locale: string }>; }) { - unstable_setRequestLocale(locale); - const t = useTranslations('about'); - const tFAQ = useTranslations('about.FAQ') + const { locale } = await params; + const t = await getTranslations('about'); + const tFAQ = await getTranslations('about.FAQ') const cardData = [ { id: 1, title: t('leaderboard.title'), content: t('leaderboard.about'), link: `/${locale}/about/leaderboard`},