Skip to content

Commit 404c5c7

Browse files
committed
add it on get-eth page
1 parent 08a7b1d commit 404c5c7

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/pages/get-eth.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { useTranslation } from "next-i18next"
33
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
44
import type { ReactNode } from "react"
55

6-
import type { BasePageProps, ChildOnlyProp, Lang } from "@/lib/types"
6+
import type {
7+
BasePageProps,
8+
ChildOnlyProp,
9+
CommitHistory,
10+
Lang,
11+
} from "@/lib/types"
712

813
import CalloutBanner from "@/components/CalloutBanner"
914
import CardList, {
@@ -13,6 +18,7 @@ import CentralizedExchanges from "@/components/CentralizedExchanges"
1318
import Emoji from "@/components/Emoji"
1419
import EthPriceCard from "@/components/EthPriceCard"
1520
import FeedbackCard from "@/components/FeedbackCard"
21+
import FileContributors from "@/components/FileContributors"
1622
import { Image } from "@/components/Image"
1723
import MainArticle from "@/components/MainArticle"
1824
import PageMetadata from "@/components/PageMetadata"
@@ -31,6 +37,7 @@ import { Stack } from "@/components/ui/flex"
3137
import InlineLink from "@/components/ui/Link"
3238

3339
import { cn } from "@/lib/utils/cn"
40+
import { getPageContributorInfo } from "@/lib/utils/contributors"
3441
import { existsNamespace } from "@/lib/utils/existsNamespace"
3542
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
3643
import { getLastModifiedDateByPath } from "@/lib/utils/gh"
@@ -89,18 +96,31 @@ export const getStaticProps = (async ({ locale }) => {
8996
lastDeployDate
9097
)
9198

99+
const commitHistoryCache: CommitHistory = {}
100+
101+
const { contributors, lastEditLocaleTimestamp } =
102+
await getPageContributorInfo(
103+
"learn.tsx",
104+
locale as Lang,
105+
commitHistoryCache
106+
)
107+
92108
return {
93109
props: {
94110
...(await serverSideTranslations(locale!, requiredNamespaces)),
95111
contentNotTranslated,
96112
lastDeployLocaleTimestamp,
97113
lastDataUpdateDate,
114+
contributors,
115+
lastEditLocaleTimestamp,
98116
},
99117
}
100118
}) satisfies GetStaticProps<Props>
101119

102120
const GetEthPage = ({
103121
lastDataUpdateDate,
122+
contributors,
123+
lastEditLocaleTimestamp,
104124
}: InferGetStaticPropsType<typeof getStaticProps>) => {
105125
const { t } = useTranslation("page-get-eth")
106126

@@ -378,6 +398,11 @@ const GetEthPage = ({
378398
</Stack>
379399
</Stack>
380400
</TwoColumnContent>
401+
<FileContributors
402+
className="my-10 border-t"
403+
contributors={contributors}
404+
lastEditLocaleTimestamp={lastEditLocaleTimestamp}
405+
/>
381406
</Stack>
382407

383408
<Divider className="mx-auto my-16 md:my-32" />

0 commit comments

Comments
 (0)