1
- import { ReactNode } from "react"
1
+ import { HTMLAttributes , ReactNode } from "react"
2
2
import { GetStaticProps } from "next"
3
3
import { useTranslation } from "next-i18next"
4
4
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
5
- import {
6
- Box ,
7
- chakra ,
8
- Flex ,
9
- Heading ,
10
- SimpleGrid ,
11
- Stack ,
12
- TextProps ,
13
- } from "@chakra-ui/react"
14
5
15
6
import { BasePageProps , ChildOnlyProp , Lang } from "@/lib/types"
16
7
17
- import ButtonLink from "@/components/Buttons/ButtonLink"
18
8
import Callout from "@/components/Callout"
19
9
import Card , { CardProps } from "@/components/Card"
20
10
import FeedbackCard from "@/components/FeedbackCard"
11
+ import Heading from "@/components/Heading"
21
12
import HubHero from "@/components/Hero/HubHero"
22
- import { Image } from "@/components/Image"
23
- import InlineLink from "@/components/Link"
13
+ import { TwImage } from "@/components/Image"
24
14
import MainArticle from "@/components/MainArticle"
25
- import OldHeading from "@/components/OldHeading"
26
- import Text from "@/components/OldText"
27
15
import PageMetadata from "@/components/PageMetadata"
28
16
import Translation from "@/components/Translation"
17
+ import { ButtonLink } from "@/components/ui/buttons/Button"
18
+ import { Flex , Stack , VStack } from "@/components/ui/flex"
19
+ import InlineLink from "@/components/ui/Link"
29
20
21
+ import { cn } from "@/lib/utils/cn"
30
22
import { existsNamespace } from "@/lib/utils/existsNamespace"
31
23
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
32
24
import { getLocaleTimestamp } from "@/lib/utils/time"
@@ -38,77 +30,67 @@ import DogeImage from "@/public/images/doge-computer.png"
38
30
import HeroImage from "@/public/images/heroes/developers-hub-hero.jpg"
39
31
40
32
const Page = ( props : ChildOnlyProp ) => (
41
- < Flex
42
- flexDirection = "column"
43
- alignItems = "center"
44
- w = "full"
45
- my = { 0 }
46
- mx = "auto"
47
- { ...props }
48
- />
33
+ < VStack className = "mx-auto my-0 w-full" { ...props } />
49
34
)
50
35
51
36
const GrayContainer = ( props : ChildOnlyProp ) => (
52
- < Box
53
- w = "full"
54
- py = { 16 }
55
- px = { 0 }
56
- mt = { 8 }
57
- bg = "grayBackground"
58
- boxShadow = "inset 0px 1px 0px var(--eth-colors-tableItemBoxShadow)"
37
+ < div
38
+ className = "mt-8 w-full border-t bg-background-highlight px-0 py-16 shadow-table-item-box"
59
39
{ ...props }
60
40
/>
61
41
)
62
42
63
43
const Content = ( props : ChildOnlyProp ) => (
64
- < Box as = { MainArticle } py = { 4 } px = { 8 } w = "full " { ...props } />
44
+ < MainArticle className = "w-full px-8 py-4 " { ...props } />
65
45
)
66
46
67
- const Subtitle = ( props : TextProps ) => (
68
- < Text fontSize = "xl" lineHeight = "140%" color = "text200" { ...props } />
47
+ const Subtitle = ( {
48
+ className,
49
+ ...props
50
+ } : HTMLAttributes < HTMLHeadingElement > ) => (
51
+ < p className = { cn ( "leading-xs text-body-medium" , className ) } { ...props } />
69
52
)
70
53
71
- const MonoSubtitle = ( props : ChildOnlyProp ) => < OldHeading mb = { 0 } { ...props } />
54
+ const MonoSubtitle = ( props : ChildOnlyProp ) => (
55
+ < h2 className = "mb-0 mt-12" { ...props } />
56
+ )
57
+
58
+ const H2 = ( props : ChildOnlyProp ) => < h2 className = "mb-8 mt-12" { ...props } />
59
+
60
+ const H3 = ( props : ChildOnlyProp ) => < h3 className = "mb-8 mt-10" { ...props } />
61
+
62
+ const Text = ( props : ChildOnlyProp ) => < p className = "mb-6" { ...props } />
72
63
73
64
const StyledCardContainer = ( props : ChildOnlyProp ) => (
74
- < SimpleGrid columns = { [ 1 , 1 , 2 , 4 ] } mx = { - 4 } mt = { 8 } mb = { 12 } { ...props } />
65
+ < div
66
+ className = "-mx-4 mb-12 mt-8 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
67
+ { ...props }
68
+ />
75
69
)
76
70
77
71
const TwoColumnContent = ( props : ChildOnlyProp ) => (
78
72
< Flex
79
- justifyContent = "space-between"
80
- alignItems = { { base : "flex-start" , lg : "center" } }
81
- flexDirection = { { base : "column" , lg : "row" } }
82
- w = "100%"
73
+ className = "w-full flex-col items-start justify-between lg:flex-row lg:items-center"
83
74
{ ...props }
84
75
/>
85
76
)
86
77
87
78
const ThreeColumnContent = ( props : ChildOnlyProp ) => (
88
79
< Flex
89
- py = { 0 }
90
- px = { 8 }
91
- w = "full"
92
- justifyContent = "space-between"
93
- alignItems = { { base : "flex-start" , lg : "flex-start" } }
94
- flexDirection = { { base : "column" , lg : "row" } }
80
+ className = "flex-col items-start justify-between px-8 py-0 lg:flex-row"
95
81
{ ...props }
96
82
/>
97
83
)
98
84
99
85
const Column = ( props : ChildOnlyProp ) => (
100
- < Box flex = "1 1 33%" mb = { 6 } me = { 8 } w = " full" { ...props } />
86
+ < div className = "mb-6 me-8 w- full flex-1 basis-1/3 " { ...props } />
101
87
)
102
88
const RightColumn = ( props : ChildOnlyProp ) => (
103
- < Box flex = "1 1 33%" mb = { 6 } me = { 0 } w = " full" { ...props } />
89
+ < div className = "mb-6 me-0 w- full flex-1 basis-1/3 " { ...props } />
104
90
)
105
91
const IntroColumn = ( props : ChildOnlyProp ) => (
106
- < Box
107
- flex = "1 1 33%"
108
- mb = { 6 }
109
- mt = { { base : 0 , lg : 32 } }
110
- me = { { base : 0 , sm : 8 } }
111
- w = "full"
92
+ < div
93
+ className = "mb-6 me-0 mt-0 w-full flex-1 basis-1/3 sm:me-8 lg:mt-32"
112
94
{ ...props }
113
95
/>
114
96
)
@@ -122,44 +104,26 @@ const StyledCard = (props: CardProps) => {
122
104
)
123
105
}
124
106
125
- const StyledCallout = chakra ( Callout , {
126
- baseStyle : {
127
- flex : { base : "auto" , md : "1 1 416px" } ,
128
- } ,
129
- } )
130
-
131
107
const SpeedRunEthereumBanner = ( {
132
108
title,
133
109
linkLabel,
134
110
} : {
135
111
title : string
136
112
linkLabel : string
137
113
} ) => (
138
- < Box position = "relative" mb = { { xl : 12 } } >
139
- < Image
114
+ < div className = "relative xl:mb-12" >
115
+ < TwImage
116
+ className = "h-[450px] xl:h-auto"
140
117
src = { SpeedRunEthereumImage }
141
118
alt = "SpeedRunEthereum banner"
142
119
sizes = "100vw"
143
120
style = { { width : "100vw" , objectFit : "cover" , objectPosition : "20%" } }
144
- h = { {
145
- base : "450px" ,
146
- xl : "auto" ,
147
- } }
148
121
/>
149
- < Stack
150
- spacing = { { base : "3" , md : "4" } }
151
- p = { { base : "6" , lg : "8" } }
152
- position = "absolute"
153
- insetInlineStart = { { md : "8" } }
154
- maxW = { { base : "lg" , xl : "xl" } }
155
- top = { { base : "0" , md : "50" } }
156
- wordBreak = "break-word"
157
- alignItems = "flex-start"
158
- >
122
+ < Stack className = "absolute top-0 max-w-lg items-start space-y-3 break-words p-6 md:top-12 md:ms-8 md:space-y-4 lg:p-8 xl:max-w-xl" >
159
123
< Heading > { title } </ Heading >
160
124
< ButtonLink href = "https://speedrunethereum.com/" > { linkLabel } </ ButtonLink >
161
125
</ Stack >
162
- </ Box >
126
+ </ div >
163
127
)
164
128
165
129
export const getStaticProps = ( async ( { locale } ) => {
@@ -282,10 +246,10 @@ const DevelopersPage = () => {
282
246
/>
283
247
< TwoColumnContent >
284
248
< IntroColumn >
285
- < OldHeading >
249
+ < H2 >
286
250
< Translation id = "page-developers-index:page-developers-about" />
287
- </ OldHeading >
288
- < Subtitle mb = { 6 } >
251
+ </ H2 >
252
+ < Subtitle className = "mb-6" >
289
253
< Translation id = "page-developers-index:page-developers-about-desc" />
290
254
</ Subtitle >
291
255
< Text >
@@ -298,7 +262,8 @@ const DevelopersPage = () => {
298
262
</ InlineLink >
299
263
</ Text >
300
264
</ IntroColumn >
301
- < StyledCallout
265
+ < Callout
266
+ className = "flex-auto md:flex-[1_1_416px]"
302
267
image = { DevelopersImage }
303
268
titleKey = "page-developers-index:page-developers-improve-ethereum"
304
269
descriptionKey = "page-developers-index:page-developers-improve-ethereum-desc"
@@ -309,21 +274,21 @@ const DevelopersPage = () => {
309
274
< Translation id = "page-developers-index:page-developers-contribute" />
310
275
</ ButtonLink >
311
276
</ div >
312
- </ StyledCallout >
277
+ </ Callout >
313
278
</ TwoColumnContent >
314
279
</ Content >
315
280
< GrayContainer >
316
281
< Content >
317
- < OldHeading >
282
+ < H2 >
318
283
< Translation id = "page-developers-index:page-developers-explore-documentation" />
319
- </ OldHeading >
284
+ </ H2 >
320
285
</ Content >
321
286
322
287
< ThreeColumnContent >
323
288
< Column >
324
- < OldHeading as = "h3" fontSize = { { base : "xl" , md : "2xl" } } >
289
+ < H3 >
325
290
< Translation id = "page-developers-index:page-developers-docs-introductions" />
326
- </ OldHeading >
291
+ </ H3 >
327
292
< InlineLink href = "/developers/docs/intro-to-ethereum/" >
328
293
< Translation id = "page-developers-index:page-developers-intro-eth-link" />
329
294
</ InlineLink >
@@ -365,18 +330,16 @@ const DevelopersPage = () => {
365
330
< Text >
366
331
< Translation id = "page-developers-index:page-developers-language-desc" />
367
332
</ Text >
368
- < Image
369
- hideBelow = "lg "
333
+ < TwImage
334
+ className = "mt-16 hidden max-w-[400px] lg:block "
370
335
src = { DogeImage }
371
336
alt = { t ( "page-assets-doge" ) }
372
- maxW = "400px"
373
- mt = { 16 }
374
337
/>
375
338
</ Column >
376
339
< Column >
377
- < OldHeading as = "h3" fontSize = { { base : "xl" , md : "2xl" } } >
340
+ < H3 >
378
341
< Translation id = "page-developers-index:page-developers-fundamentals" />
379
- </ OldHeading >
342
+ </ H3 >
380
343
< InlineLink href = "/developers/docs/accounts/" >
381
344
< Translation id = "page-developers-index:page-developers-accounts-link" />
382
345
</ InlineLink >
@@ -441,9 +404,9 @@ const DevelopersPage = () => {
441
404
</ Text >
442
405
</ Column >
443
406
< RightColumn >
444
- < OldHeading as = "h3" fontSize = { { base : "xl" , md : "2xl" } } >
407
+ < H3 >
445
408
< Translation id = "page-developers-index:page-developers-stack" />
446
- </ OldHeading >
409
+ </ H3 >
447
410
< InlineLink href = "/developers/docs/smart-contracts/" >
448
411
< Translation id = "page-developers-index:page-developers-smart-contracts-link" />
449
412
</ InlineLink >
@@ -492,9 +455,9 @@ const DevelopersPage = () => {
492
455
< Text >
493
456
< Translation id = "page-developers-index:page-developers-dev-env-desc" />
494
457
</ Text >
495
- < OldHeading as = "h3" fontSize = { { base : "xl" , md : "2xl" } } >
458
+ < H3 >
496
459
< Translation id = "page-developers-index:page-developers-advanced" />
497
- </ OldHeading >
460
+ </ H3 >
498
461
< InlineLink href = "/developers/docs/standards/tokens/" >
499
462
< Translation id = "page-developers-index:page-developers-token-standards-link" />
500
463
</ InlineLink >
0 commit comments