From cea7f8bcc6f2ba3fae9e4241e0c5e4600c88ab0b Mon Sep 17 00:00:00 2001 From: Pablo Date: Wed, 18 Jun 2025 18:10:56 +0200 Subject: [PATCH 1/2] pass locale to hero component --- app/[locale]/page.tsx | 2 +- src/components/Hero/HomeHero/index.tsx | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 26dfd6cf9cd..816818b7c5e 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -447,7 +447,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {

- +
{subHeroCTAs.map( diff --git a/src/components/Hero/HomeHero/index.tsx b/src/components/Hero/HomeHero/index.tsx index d84354946f1..8d41eb1d20a 100644 --- a/src/components/Hero/HomeHero/index.tsx +++ b/src/components/Hero/HomeHero/index.tsx @@ -1,21 +1,24 @@ -import type { ClassNameProp, CommonHeroProps } from "@/lib/types" +import { getTranslations } from "next-intl/server" + +import type { ClassNameProp, CommonHeroProps, Lang } from "@/lib/types" import LanguageMorpher from "@/components/Homepage/LanguageMorpher" import { Image } from "@/components/Image" -import useTranslation from "@/hooks/useTranslation" - -export type HomeHeroProps = Pick & ClassNameProp +export type HomeHeroProps = Pick & + ClassNameProp & { + locale: Lang + } -const HomeHero = ({ heroImg, className }: HomeHeroProps) => { - const { t } = useTranslation("page-index") +const HomeHero = async ({ heroImg, className, locale }: HomeHeroProps) => { + const t = await getTranslations({ locale, namespace: "page-index" }) return (
{t("page-index:page-index-hero-image-alt")} {
-

{t("page-index:page-index-title")}

+

{t("page-index-title")}

- {t("page-index:page-index-description")} + {t("page-index-description")}

From 52c8741f4090daec6f7741455b9b727e6cd2cee5 Mon Sep 17 00:00:00 2001 From: Pablo Date: Wed, 18 Jun 2025 18:23:14 +0200 Subject: [PATCH 2/2] remove home hero story until for issues rendering server components in sb --- .storybook/main.ts | 3 ++ .../Hero/HomeHero/HomeHero.stories.tsx | 35 ------------------- 2 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 src/components/Hero/HomeHero/HomeHero.stories.tsx diff --git a/.storybook/main.ts b/.storybook/main.ts index cfa9176163a..7fc65a2c201 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -77,5 +77,8 @@ const config: StorybookConfig = { reactDocgen: "react-docgen-typescript", }, + features: { + experimentalRSC: true, + }, } export default config diff --git a/src/components/Hero/HomeHero/HomeHero.stories.tsx b/src/components/Hero/HomeHero/HomeHero.stories.tsx deleted file mode 100644 index 4019017e809..00000000000 --- a/src/components/Hero/HomeHero/HomeHero.stories.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { Meta, StoryObj } from "@storybook/react" - -import { langViewportModes } from "@/storybook/modes" - -import HomeHeroComponent from "." - -import homeHeroImg from "@/public/images/home/hero.png" - -const meta = { - title: "Organisms / Layouts / Hero", - component: HomeHeroComponent, - parameters: { - layout: "none", - chromatic: { - modes: { - ...langViewportModes, - }, - }, - }, - argTypes: { - heroImg: { - table: { - disable: true, - }, - }, - }, -} satisfies Meta - -export default meta - -export const HomeHero: StoryObj = { - args: { - heroImg: homeHeroImg, - }, -}