Skip to content

Commit 6a8b8ef

Browse files
committed
add it on layer-2/learn page
1 parent 9791be1 commit 6a8b8ef

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/pages/layer-2/learn.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { useRouter } from "next/router"
33
import { useTranslation } from "next-i18next"
44
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
55

6-
import type { BasePageProps, Lang } from "@/lib/types"
6+
import type { BasePageProps, CommitHistory, Lang } from "@/lib/types"
77

88
import Callout from "@/components/Callout"
99
import Card from "@/components/Card"
10+
import FileContributors from "@/components/FileContributors"
1011
import { ContentHero, type ContentHeroProps } from "@/components/Hero"
1112
import { Image } from "@/components/Image"
1213
import MainArticle from "@/components/MainArticle"
@@ -15,6 +16,7 @@ import { StandaloneQuizWidget } from "@/components/Quiz/QuizWidget"
1516
import Translation from "@/components/Translation"
1617
import { ButtonLink } from "@/components/ui/buttons/Button"
1718

19+
import { getPageContributorInfo } from "@/lib/utils/contributors"
1820
import { existsNamespace } from "@/lib/utils/existsNamespace"
1921
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
2022
import { getLocaleTimestamp } from "@/lib/utils/time"
@@ -39,16 +41,27 @@ export const getStaticProps = (async ({ locale }) => {
3941

4042
const contentNotTranslated = !existsNamespace(locale!, requiredNamespaces[2])
4143

44+
const commitHistoryCache: CommitHistory = {}
45+
46+
const { contributors, lastEditLocaleTimestamp } =
47+
await getPageContributorInfo(
48+
"layer-2/learn.tsx",
49+
locale as Lang,
50+
commitHistoryCache
51+
)
52+
4253
return {
4354
props: {
4455
...(await serverSideTranslations(locale!, requiredNamespaces)),
4556
contentNotTranslated,
4657
lastDeployLocaleTimestamp,
58+
contributors,
59+
lastEditLocaleTimestamp,
4760
},
4861
}
4962
}) satisfies GetStaticProps<BasePageProps>
5063

51-
const Layer2Learn = () => {
64+
const Layer2Learn = ({ contributors, lastEditLocaleTimestamp }) => {
5265
const { t } = useTranslation("page-layer-2-learn")
5366
const { pathname } = useRouter()
5467

@@ -309,6 +322,11 @@ const Layer2Learn = () => {
309322
</p>
310323
</div>
311324
</div>
325+
<FileContributors
326+
className="my-10 border-t"
327+
contributors={contributors}
328+
lastEditLocaleTimestamp={lastEditLocaleTimestamp}
329+
/>
312330
</div>
313331

314332
<div id="callout-cards" className="px-8 py-9">

0 commit comments

Comments
 (0)