From 1427c8e7923dc69ec0838ee6d060860dc6483146 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Wed, 19 Oct 2022 19:58:48 +0530 Subject: [PATCH] Fix social previews title and description by doing server side translation (#5098) --- apps/web/pages/apps/index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/web/pages/apps/index.tsx b/apps/web/pages/apps/index.tsx index 461b23e675..886fd25b28 100644 --- a/apps/web/pages/apps/index.tsx +++ b/apps/web/pages/apps/index.tsx @@ -9,6 +9,8 @@ import AppStoreCategories from "@calcom/ui/v2/core/apps/Categories"; import TrendingAppsSlider from "@calcom/ui/v2/core/apps/TrendingAppsSlider"; import AppsLayout from "@calcom/ui/v2/core/layouts/AppsLayout"; +import { ssgInit } from "@server/lib/ssg"; + export default function Apps({ appStore, categories }: InferGetStaticPropsType) { const { t } = useLocale(); @@ -22,6 +24,8 @@ export default function Apps({ appStore, categories }: InferGetStaticPropsType { + const ssg = await ssgInit(context); + const session = await getSession(context); let appStore; @@ -42,6 +46,7 @@ export const getServerSideProps = async (context: NextPageContext) => { }, {} as Record); return { props: { + trpcState: ssg.dehydrate(), categories: Object.entries(categories) .map(([name, count]): { name: AppCategories; count: number } => ({ name: name as AppCategories,