Skip to content

Commit dd73ab9

Browse files
committed
Merge branch 'ssr-developers-page' into speed-run
2 parents 78e2ff0 + b8f1fde commit dd73ab9

File tree

1 file changed

+26
-60
lines changed

1 file changed

+26
-60
lines changed

app/[locale]/developers/page.tsx

Lines changed: 26 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HTMLAttributes, ReactNode } from "react"
1+
import { ReactNode } from "react"
22
import { getTranslations } from "next-intl/server"
33

44
import { Lang } from "@/lib/types"
@@ -13,63 +13,22 @@ import { Image } from "@/components/Image"
1313
import MainArticle from "@/components/MainArticle"
1414
import { ButtonLink } from "@/components/ui/buttons/Button"
1515
import { Card } from "@/components/ui/card"
16-
import { Flex, VStack } from "@/components/ui/flex"
16+
import { VStack } from "@/components/ui/flex"
1717
import InlineLink from "@/components/ui/Link"
1818

19-
import { cn } from "@/lib/utils/cn"
2019
import { getMetadata } from "@/lib/utils/metadata"
2120

2221
import SpeedRunEthereumImage from "@/public/images/dev-tools/speed-run-ethereum-banner.png"
2322
import DevelopersImage from "@/public/images/developers-eth-blocks.png"
2423
import DogeImage from "@/public/images/doge-computer.png"
2524
import HeroImage from "@/public/images/heroes/developers-hub-hero.jpg"
2625

27-
const Page = (props: ChildOnlyProp) => (
28-
<VStack className="mx-auto my-0 w-full" {...props} />
29-
)
30-
31-
const GrayContainer = (props: ChildOnlyProp) => (
32-
<div
33-
className="mt-8 w-full border-t bg-background-highlight px-0 py-16 shadow-table-item-box"
34-
{...props}
35-
/>
36-
)
37-
38-
const Content = (props: ChildOnlyProp) => (
39-
<MainArticle className="w-full px-8 py-4" {...props} />
40-
)
41-
42-
const Subtitle = ({
43-
className,
44-
...props
45-
}: HTMLAttributes<HTMLHeadingElement>) => (
46-
<p className={cn("leading-xs text-body-medium", className)} {...props} />
47-
)
48-
49-
const MonoSubtitle = (props: ChildOnlyProp) => (
50-
<h2 className="mb-0 mt-12" {...props} />
51-
)
52-
5326
const H2 = (props: ChildOnlyProp) => <h2 className="mb-8 mt-12" {...props} />
5427

5528
const H3 = (props: ChildOnlyProp) => <h3 className="mb-8 mt-10" {...props} />
5629

5730
const Text = (props: ChildOnlyProp) => <p className="mb-6" {...props} />
5831

59-
const TwoColumnContent = (props: ChildOnlyProp) => (
60-
<Flex
61-
className="w-full flex-col items-start justify-between lg:flex-row lg:items-center"
62-
{...props}
63-
/>
64-
)
65-
66-
const ThreeColumnContent = (props: ChildOnlyProp) => (
67-
<Flex
68-
className="flex-col items-start justify-between px-8 py-0 lg:flex-row"
69-
{...props}
70-
/>
71-
)
72-
7332
const Column = (props: ChildOnlyProp) => (
7433
<div className="mb-6 me-8 w-full flex-1 basis-1/3" {...props} />
7534
)
@@ -101,6 +60,10 @@ const DevelopersPage = async ({
10160
locale,
10261
namespace: "page-developers-index",
10362
})
63+
const tCommon = await getTranslations({
64+
locale,
65+
namespace: "common",
66+
})
10467

10568
const paths: DevelopersPath[] = [
10669
{
@@ -145,17 +108,18 @@ const DevelopersPage = async ({
145108
]
146109

147110
return (
148-
<Page>
111+
<VStack className="mx-auto my-0 w-full">
149112
<HubHero
150113
heroImg={HeroImage}
151114
header={`${t("page-developers-title-1")} ${t(
152115
"page-developers-title-2"
153116
)} ${t("page-developers-title-3")}`}
154-
title={t("common:developers")}
117+
title={tCommon("developers")}
155118
description={t("page-developers-subtitle")}
156119
/>
157-
<Content>
158-
<MonoSubtitle>{t("page-developers-get-started")}</MonoSubtitle>
120+
121+
<MainArticle className="w-full space-y-12 px-8 py-4">
122+
<h2 className="-mb-4 mt-12">{t("page-developers-get-started")}</h2>
159123

160124
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 md:gap-8 xl:mb-12">
161125
<div
@@ -206,7 +170,8 @@ const DevelopersPage = async ({
206170
</div>
207171
</Card>
208172
</div>
209-
<div className="-mx-4 mb-12 mt-8 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4">
173+
174+
<div className="-mx-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4">
210175
{paths.map((path, idx) => (
211176
<OldCard
212177
className={`m-4 p-6 shadow-[0px_1px_3px_rgba(0,0,0,0.1)] transition-transform duration-100 hover:scale-105 hover:rounded hover:bg-background-highlight hover:shadow-[0px_8px_17px_rgba(0,0,0,0.15)] dark:shadow-[0px_1px_3px_rgba(60,60,60,0.1)]`}
@@ -220,12 +185,12 @@ const DevelopersPage = async ({
220185
))}
221186
</div>
222187

223-
<TwoColumnContent>
188+
<div className="flex w-full flex-col items-start justify-between lg:flex-row lg:items-center">
224189
<IntroColumn>
225190
<H2>{t("page-developers-about")}</H2>
226-
<Subtitle className="mb-6">
191+
<p className="mb-6 leading-xs text-body-medium">
227192
{t("page-developers-about-desc")}
228-
</Subtitle>
193+
</p>
229194
<Text>{t("page-developers-about-desc-2")}</Text>
230195
<Text>
231196
{t("page-developers-feedback")}{" "}
@@ -247,14 +212,15 @@ const DevelopersPage = async ({
247212
</ButtonLink>
248213
</div>
249214
</CalloutSSR>
250-
</TwoColumnContent>
251-
</Content>
252-
<GrayContainer>
253-
<Content>
215+
</div>
216+
</MainArticle>
217+
218+
<div className="mt-8 w-full border-t bg-background-highlight px-0 py-16 shadow-table-item-box">
219+
<div className="w-full scroll-mt-24 px-8 py-4">
254220
<H2>{t("page-developers-explore-documentation")}</H2>
255-
</Content>
221+
</div>
256222

257-
<ThreeColumnContent>
223+
<div className="flex flex-col items-start justify-between px-8 py-0 lg:flex-row">
258224
<Column>
259225
<H3>{t("page-developers-docs-introductions")}</H3>
260226
<InlineLink href="/developers/docs/intro-to-ethereum/">
@@ -401,10 +367,10 @@ const DevelopersPage = async ({
401367
{t("page-developers-data-structures-and-encoding-desc")}
402368
</Text>
403369
</RightColumn>
404-
</ThreeColumnContent>
405-
</GrayContainer>
370+
</div>
371+
</div>
406372
<FeedbackCard />
407-
</Page>
373+
</VStack>
408374
)
409375
}
410376

0 commit comments

Comments
 (0)