fix: flash of i18n in teams page (#6818)

This commit is contained in:
Nafees Nazik 2023-01-31 23:35:18 +05:30 committed by GitHub
parent d1a877e70d
commit 9d118d4e34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,7 @@ const Members = ({ members, teamName }: { members: MembersType; teamName: string
);
};
const Team = ({ team }: TeamPageProps) => {
const Team = ({ team }: Omit<TeamPageProps, "trpcState">) => {
return (
<div>
<Members members={team.members} teamName={team.name} />

View File

@ -21,6 +21,8 @@ import { inferSSRProps } from "@lib/types/inferSSRProps";
import Team from "@components/team/screens/Team";
import { ssrInit } from "@server/lib/ssr";
const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true });
export type TeamPageProps = inferSSRProps<typeof getServerSideProps>;
@ -143,6 +145,7 @@ function TeamPage({ team }: TeamPageProps) {
}
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
const slug = Array.isArray(context.query?.slug) ? context.query.slug.pop() : context.query.slug;
const team = await getTeamWithMembers(undefined, slug);
@ -160,6 +163,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
return {
props: {
team,
trpcState: ssr.dehydrate(),
},
};
};