Skip to content

Commit 82f1de2

Browse files
committed
fix: add contentNotTranslated prop to wallet pages
1 parent 11cdc3e commit 82f1de2

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/pages/wallets/find-wallet.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
useTheme,
2222
} from "@chakra-ui/react"
2323

24-
import { ChildOnlyProp } from "@/lib/types"
24+
import { BasePageProps, ChildOnlyProp } from "@/lib/types"
2525

2626
import BannerNotification from "@/components/BannerNotification"
2727
import Breadcrumbs from "@/components/Breadcrumbs"
@@ -33,6 +33,7 @@ import { Image } from "@/components/Image"
3333
import OldHeading from "@/components/OldHeading"
3434
import PageMetadata from "@/components/PageMetadata"
3535

36+
import { existsNamespace } from "@/lib/utils/existsNamespace"
3637
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
3738
import { trackCustomEvent } from "@/lib/utils/matomo"
3839
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
@@ -87,18 +88,22 @@ const filterDefault = {
8788
export type FiltersType = typeof filterDefault
8889

8990
export const getStaticProps = (async ({ locale }) => {
91+
const lastDeployDate = getLastDeployDate()
92+
9093
const requiredNamespaces = getRequiredNamespacesForPage(
9194
"/wallets/find-wallet"
9295
)
93-
const lastDeployDate = getLastDeployDate()
96+
97+
const contentNotTranslated = !existsNamespace(locale!, requiredNamespaces[3])
9498

9599
return {
96100
props: {
97101
...(await serverSideTranslations(locale!, requiredNamespaces)),
102+
contentNotTranslated,
98103
lastDeployDate,
99104
},
100105
}
101-
}) satisfies GetStaticProps<SSRConfig>
106+
}) satisfies GetStaticProps<BasePageProps>
102107

103108
const FindWalletPage = () => {
104109
const randomizedWalletData = shuffle(walletData)

src/pages/wallets/index.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
Text as ChakraText,
1212
} from "@chakra-ui/react"
1313

14-
import { ChildOnlyProp } from "@/lib/types"
14+
import { BasePageProps, ChildOnlyProp } from "@/lib/types"
1515

1616
import ButtonLink from "@/components/Buttons/ButtonLink"
1717
import Callout from "@/components/Callout"
@@ -29,8 +29,8 @@ import PageMetadata from "@/components/PageMetadata"
2929
import { StandaloneQuizWidget } from "@/components/Quiz/QuizWidget"
3030
import { Simulator } from "@/components/Simulator"
3131
import { SIMULATOR_ID } from "@/components/Simulator/constants"
32-
import Translation from "@/components/Translation"
3332

33+
import { existsNamespace } from "@/lib/utils/existsNamespace"
3434
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
3535
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
3636

@@ -127,22 +127,21 @@ const CalloutCardContainer = (props: ChildOnlyProp) => (
127127
<CardContainer mt={16} {...props} />
128128
)
129129

130-
131-
type Props = SSRConfig & {
132-
lastDeployDate: string
133-
}
134130
export const getStaticProps = (async ({ locale }) => {
135131
const lastDeployDate = getLastDeployDate()
136132

137133
const requiredNamespaces = getRequiredNamespacesForPage("/wallets")
138134

135+
const contentNotTranslated = !existsNamespace(locale!, requiredNamespaces[2])
136+
139137
return {
140138
props: {
141139
...(await serverSideTranslations(locale!, requiredNamespaces)),
140+
contentNotTranslated,
142141
lastDeployDate,
143142
},
144143
}
145-
}) satisfies GetStaticProps<Props>
144+
}) satisfies GetStaticProps<BasePageProps>
146145

147146
const WalletsPage = () => {
148147
const { locale } = useRouter()
@@ -208,7 +207,7 @@ const WalletsPage = () => {
208207
description: t("page-wallets-your-login-desc"),
209208
},
210209
]
211-
210+
212211
const types = [
213212
{
214213
emoji: ":cd:",
@@ -231,7 +230,7 @@ const WalletsPage = () => {
231230
description: t("page-wallets-desktop"),
232231
},
233232
]
234-
233+
235234
const articles = [
236235
{
237236
title: t("page-wallets-protecting-yourself"),
@@ -249,7 +248,7 @@ const WalletsPage = () => {
249248
link: "https://media.consensys.net/how-to-store-digital-assets-on-ethereum-a2bfdcf66bd0",
250249
},
251250
]
252-
251+
253252
const guides = [
254253
{
255254
title: t("additional-reading-how-to-create-an-ethereum-account"),

0 commit comments

Comments
 (0)