Fix social previews title and description by doing server side translation (#5098)
parent
baa641d1f4
commit
1427c8e792
|
@ -9,6 +9,8 @@ import AppStoreCategories from "@calcom/ui/v2/core/apps/Categories";
|
||||||
import TrendingAppsSlider from "@calcom/ui/v2/core/apps/TrendingAppsSlider";
|
import TrendingAppsSlider from "@calcom/ui/v2/core/apps/TrendingAppsSlider";
|
||||||
import AppsLayout from "@calcom/ui/v2/core/layouts/AppsLayout";
|
import AppsLayout from "@calcom/ui/v2/core/layouts/AppsLayout";
|
||||||
|
|
||||||
|
import { ssgInit } from "@server/lib/ssg";
|
||||||
|
|
||||||
export default function Apps({ appStore, categories }: InferGetStaticPropsType<typeof getServerSideProps>) {
|
export default function Apps({ appStore, categories }: InferGetStaticPropsType<typeof getServerSideProps>) {
|
||||||
const { t } = useLocale();
|
const { t } = useLocale();
|
||||||
|
|
||||||
|
@ -22,6 +24,8 @@ export default function Apps({ appStore, categories }: InferGetStaticPropsType<t
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getServerSideProps = async (context: NextPageContext) => {
|
export const getServerSideProps = async (context: NextPageContext) => {
|
||||||
|
const ssg = await ssgInit(context);
|
||||||
|
|
||||||
const session = await getSession(context);
|
const session = await getSession(context);
|
||||||
|
|
||||||
let appStore;
|
let appStore;
|
||||||
|
@ -42,6 +46,7 @@ export const getServerSideProps = async (context: NextPageContext) => {
|
||||||
}, {} as Record<string, number>);
|
}, {} as Record<string, number>);
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
trpcState: ssg.dehydrate(),
|
||||||
categories: Object.entries(categories)
|
categories: Object.entries(categories)
|
||||||
.map(([name, count]): { name: AppCategories; count: number } => ({
|
.map(([name, count]): { name: AppCategories; count: number } => ({
|
||||||
name: name as AppCategories,
|
name: name as AppCategories,
|
||||||
|
|
Loading…
Reference in New Issue