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
- useColorModeValue ,
14
- } from "@chakra-ui/react"
15
5
16
6
import { BasePageProps , ChildOnlyProp , Lang } from "@/lib/types"
17
7
18
- import ButtonLink from "@/components/Buttons/ButtonLink"
19
8
import Callout from "@/components/Callout"
20
9
import Card , { CardProps } from "@/components/Card"
21
10
import FeedbackCard from "@/components/FeedbackCard"
11
+ import Heading from "@/components/Heading"
22
12
import HubHero from "@/components/Hero/HubHero"
23
- import { Image } from "@/components/Image"
24
- import InlineLink from "@/components/Link"
13
+ import { TwImage } from "@/components/Image"
25
14
import MainArticle from "@/components/MainArticle"
26
- import OldHeading from "@/components/OldHeading"
27
- import Text from "@/components/OldText"
28
15
import PageMetadata from "@/components/PageMetadata"
29
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"
30
20
21
+ import { cn } from "@/lib/utils/cn"
31
22
import { existsNamespace } from "@/lib/utils/existsNamespace"
32
23
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
33
24
import { getLocaleTimestamp } from "@/lib/utils/time"
34
25
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
35
26
27
+ import useColorModeValue from "@/hooks/useColorModeValue"
36
28
import SpeedRunEthereumImage from "@/public/images/dev-tools/speed-run-ethereum-banner.png"
37
29
import DevelopersImage from "@/public/images/developers-eth-blocks.png"
38
30
import DogeImage from "@/public/images/doge-computer.png"
39
31
import HeroImage from "@/public/images/heroes/developers-hub-hero.jpg"
40
32
41
33
const Page = ( props : ChildOnlyProp ) => (
42
- < Flex
43
- flexDirection = "column"
44
- alignItems = "center"
45
- w = "full"
46
- my = { 0 }
47
- mx = "auto"
48
- { ...props }
49
- />
34
+ < VStack className = "mx-auto my-0 w-full" { ...props } />
50
35
)
51
36
52
37
const GrayContainer = ( props : ChildOnlyProp ) => (
53
- < Box
54
- w = "full"
55
- py = { 16 }
56
- px = { 0 }
57
- mt = { 8 }
58
- bg = "grayBackground"
59
- boxShadow = "inset 0px 1px 0px var(--eth-colors-tableItemBoxShadow)"
38
+ < div
39
+ className = "mt-8 w-full border-t bg-background-highlight px-0 py-16 shadow-table-item-box"
60
40
{ ...props }
61
41
/>
62
42
)
63
43
64
44
const Content = ( props : ChildOnlyProp ) => (
65
- < Box as = { MainArticle } py = { 4 } px = { 8 } w = "full " { ...props } />
45
+ < MainArticle className = "w-full px-8 py-4 " { ...props } />
66
46
)
67
47
68
- const Subtitle = ( props : TextProps ) => (
69
- < Text fontSize = "xl" lineHeight = "140%" color = "text200" { ...props } />
48
+ const Subtitle = ( {
49
+ className,
50
+ ...props
51
+ } : HTMLAttributes < HTMLHeadingElement > ) => (
52
+ < p className = { cn ( "leading-xs text-body-medium" , className ) } { ...props } />
70
53
)
71
54
72
- const MonoSubtitle = ( props : ChildOnlyProp ) => < OldHeading mb = { 0 } { ...props } />
55
+ const MonoSubtitle = ( props : ChildOnlyProp ) => (
56
+ < h2 className = "mb-0 mt-6" { ...props } />
57
+ )
58
+
59
+ const H2 = ( props : ChildOnlyProp ) => < h2 className = "mb-8 mt-12" { ...props } />
60
+
61
+ const H3 = ( props : ChildOnlyProp ) => < h3 className = "mb-8 mt-10" { ...props } />
62
+
63
+ const Text = ( props : ChildOnlyProp ) => < p className = "mb-6" { ...props } />
73
64
74
65
const StyledCardContainer = ( props : ChildOnlyProp ) => (
75
- < SimpleGrid columns = { [ 1 , 1 , 2 , 4 ] } mx = { - 4 } mt = { 8 } mb = { 12 } { ...props } />
66
+ < div
67
+ className = "-mx-4 mb-12 mt-8 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
68
+ { ...props }
69
+ />
76
70
)
77
71
78
72
const TwoColumnContent = ( props : ChildOnlyProp ) => (
79
73
< Flex
80
- justifyContent = "space-between"
81
- alignItems = { { base : "flex-start" , lg : "center" } }
82
- flexDirection = { { base : "column" , lg : "row" } }
83
- w = "100%"
74
+ className = "w-full flex-col items-start justify-between lg:flex-row lg:items-center"
84
75
{ ...props }
85
76
/>
86
77
)
87
78
88
79
const ThreeColumnContent = ( props : ChildOnlyProp ) => (
89
80
< Flex
90
- py = { 0 }
91
- px = { 8 }
92
- w = "full"
93
- justifyContent = "space-between"
94
- alignItems = { { base : "flex-start" , lg : "flex-start" } }
95
- flexDirection = { { base : "column" , lg : "row" } }
81
+ className = "flex-col items-start justify-between px-8 py-0 lg:flex-row"
96
82
{ ...props }
97
83
/>
98
84
)
99
85
100
86
const Column = ( props : ChildOnlyProp ) => (
101
- < Box flex = "1 1 33%" mb = { 6 } me = { 8 } w = " full" { ...props } />
87
+ < div className = "mb-6 me-8 w- full flex-1 basis-1/3 " { ...props } />
102
88
)
103
89
const RightColumn = ( props : ChildOnlyProp ) => (
104
- < Box flex = "1 1 33%" mb = { 6 } me = { 0 } w = " full" { ...props } />
90
+ < div className = "mb-6 me-0 w- full flex-1 basis-1/3 " { ...props } />
105
91
)
106
92
const IntroColumn = ( props : ChildOnlyProp ) => (
107
- < Box
108
- flex = "1 1 33%"
109
- mb = { 6 }
110
- mt = { { base : 0 , lg : 32 } }
111
- me = { { base : 0 , sm : 8 } }
112
- w = "full"
93
+ < div
94
+ className = "mb-6 me-0 mt-0 w-full flex-1 basis-1/3 sm:me-8 lg:mt-32"
113
95
{ ...props }
114
96
/>
115
97
)
@@ -134,44 +116,26 @@ const StyledCard = (props: CardProps) => {
134
116
)
135
117
}
136
118
137
- const StyledCallout = chakra ( Callout , {
138
- baseStyle : {
139
- flex : { base : "auto" , md : "1 1 416px" } ,
140
- } ,
141
- } )
142
-
143
119
const SpeedRunEthereumBanner = ( {
144
120
title,
145
121
linkLabel,
146
122
} : {
147
123
title : string
148
124
linkLabel : string
149
125
} ) => (
150
- < Box position = "relative" mb = { { xl : 12 } } >
151
- < Image
126
+ < div className = "relative xl:mb-12" >
127
+ < TwImage
128
+ className = "h-[450px] xl:h-auto"
152
129
src = { SpeedRunEthereumImage }
153
130
alt = "SpeedRunEthereum banner"
154
131
sizes = "100vw"
155
132
style = { { width : "100vw" , objectFit : "cover" , objectPosition : "20%" } }
156
- h = { {
157
- base : "450px" ,
158
- xl : "auto" ,
159
- } }
160
133
/>
161
- < Stack
162
- spacing = { { base : "3" , md : "4" } }
163
- p = { { base : "6" , lg : "8" } }
164
- position = "absolute"
165
- insetInlineStart = { { md : "8" } }
166
- maxW = { { base : "lg" , xl : "xl" } }
167
- top = { { base : "0" , md : "50" } }
168
- wordBreak = "break-word"
169
- alignItems = "flex-start"
170
- >
134
+ < 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" >
171
135
< Heading > { title } </ Heading >
172
136
< ButtonLink href = "https://speedrunethereum.com/" > { linkLabel } </ ButtonLink >
173
137
</ Stack >
174
- </ Box >
138
+ </ div >
175
139
)
176
140
177
141
export const getStaticProps = ( async ( { locale } ) => {
@@ -294,10 +258,10 @@ const DevelopersPage = () => {
294
258
/>
295
259
< TwoColumnContent >
296
260
< IntroColumn >
297
- < OldHeading >
261
+ < H2 >
298
262
< Translation id = "page-developers-index:page-developers-about" />
299
- </ OldHeading >
300
- < Subtitle mb = { 6 } >
263
+ </ H2 >
264
+ < Subtitle className = "mb-6" >
301
265
< Translation id = "page-developers-index:page-developers-about-desc" />
302
266
</ Subtitle >
303
267
< Text >
@@ -310,7 +274,8 @@ const DevelopersPage = () => {
310
274
</ InlineLink >
311
275
</ Text >
312
276
</ IntroColumn >
313
- < StyledCallout
277
+ < Callout
278
+ className = "flex-auto md:flex-[1_1_416px]"
314
279
image = { DevelopersImage }
315
280
titleKey = "page-developers-index:page-developers-improve-ethereum"
316
281
descriptionKey = "page-developers-index:page-developers-improve-ethereum-desc"
@@ -321,21 +286,21 @@ const DevelopersPage = () => {
321
286
< Translation id = "page-developers-index:page-developers-contribute" />
322
287
</ ButtonLink >
323
288
</ div >
324
- </ StyledCallout >
289
+ </ Callout >
325
290
</ TwoColumnContent >
326
291
</ Content >
327
292
< GrayContainer >
328
293
< Content >
329
- < OldHeading >
294
+ < H2 >
330
295
< Translation id = "page-developers-index:page-developers-explore-documentation" />
331
- </ OldHeading >
296
+ </ H2 >
332
297
</ Content >
333
298
334
299
< ThreeColumnContent >
335
300
< Column >
336
- < OldHeading as = "h3" fontSize = { { base : "xl" , md : "2xl" } } >
301
+ < H3 >
337
302
< Translation id = "page-developers-index:page-developers-docs-introductions" />
338
- </ OldHeading >
303
+ </ H3 >
339
304
< InlineLink href = "/developers/docs/intro-to-ethereum/" >
340
305
< Translation id = "page-developers-index:page-developers-intro-eth-link" />
341
306
</ InlineLink >
@@ -377,18 +342,16 @@ const DevelopersPage = () => {
377
342
< Text >
378
343
< Translation id = "page-developers-index:page-developers-language-desc" />
379
344
</ Text >
380
- < Image
381
- hideBelow = "lg "
345
+ < TwImage
346
+ className = "mt-16 hidden max-w-[400px] lg:block "
382
347
src = { DogeImage }
383
348
alt = { t ( "page-assets-doge" ) }
384
- maxW = "400px"
385
- mt = { 16 }
386
349
/>
387
350
</ Column >
388
351
< Column >
389
- < OldHeading as = "h3" fontSize = { { base : "xl" , md : "2xl" } } >
352
+ < H3 >
390
353
< Translation id = "page-developers-index:page-developers-fundamentals" />
391
- </ OldHeading >
354
+ </ H3 >
392
355
< InlineLink href = "/developers/docs/accounts/" >
393
356
< Translation id = "page-developers-index:page-developers-accounts-link" />
394
357
</ InlineLink >
@@ -453,9 +416,9 @@ const DevelopersPage = () => {
453
416
</ Text >
454
417
</ Column >
455
418
< RightColumn >
456
- < OldHeading as = "h3" fontSize = { { base : "xl" , md : "2xl" } } >
419
+ < H3 >
457
420
< Translation id = "page-developers-index:page-developers-stack" />
458
- </ OldHeading >
421
+ </ H3 >
459
422
< InlineLink href = "/developers/docs/smart-contracts/" >
460
423
< Translation id = "page-developers-index:page-developers-smart-contracts-link" />
461
424
</ InlineLink >
@@ -504,9 +467,9 @@ const DevelopersPage = () => {
504
467
< Text >
505
468
< Translation id = "page-developers-index:page-developers-dev-env-desc" />
506
469
</ Text >
507
- < OldHeading as = "h3" fontSize = { { base : "xl" , md : "2xl" } } >
470
+ < H3 >
508
471
< Translation id = "page-developers-index:page-developers-advanced" />
509
- </ OldHeading >
472
+ </ H3 >
510
473
< InlineLink href = "/developers/docs/standards/tokens/" >
511
474
< Translation id = "page-developers-index:page-developers-token-standards-link" />
512
475
</ InlineLink >
0 commit comments