Skip to content

Commit 8724ecb

Browse files
committed
fix: add contentNotTranslated prop to contributors
1 parent ad16dbd commit 8724ecb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/pages/contributing/translation-program/contributors.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ import {
1212
UnorderedList,
1313
} from "@chakra-ui/react"
1414

15+
import { BasePageProps } from "@/lib/types"
16+
1517
import Breadcrumbs from "@/components/Breadcrumbs"
1618
import FeedbackCard from "@/components/FeedbackCard"
1719
import InlineLink from "@/components/Link"
1820
import OldHeading from "@/components/OldHeading"
1921
import Text from "@/components/OldText"
2022
import PageMetadata from "@/components/PageMetadata"
2123

24+
import { existsNamespace } from "@/lib/utils/existsNamespace"
2225
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
2326
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
2427

@@ -28,21 +31,23 @@ type Props = SSRConfig & {
2831
lastDeployDate: string
2932
}
3033

31-
export const getStaticProps = (async (context) => {
32-
const { locale } = context
33-
// load i18n required namespaces for the given page
34+
export const getStaticProps = (async ({ locale }) => {
35+
const lastDeployDate = getLastDeployDate()
36+
3437
const requiredNamespaces = getRequiredNamespacesForPage(
3538
"/contributing/translation-program/contributors"
3639
)
37-
const lastDeployDate = getLastDeployDate()
40+
41+
const contentNotTranslated = !existsNamespace(locale!, requiredNamespaces[1])
3842

3943
return {
4044
props: {
4145
...(await serverSideTranslations(locale!, requiredNamespaces)),
46+
contentNotTranslated,
4247
lastDeployDate,
4348
},
4449
}
45-
}) satisfies GetStaticProps<Props>
50+
}) satisfies GetStaticProps<BasePageProps>
4651

4752
const Content = (props: BoxProps) => <Box py={4} px={10} w="full" {...props} />
4853
const ContentHeading = (props: HeadingProps) => (

0 commit comments

Comments
 (0)