1
1
import { GetStaticProps } from "next"
2
2
import { useTranslation } from "next-i18next"
3
3
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
4
- import type { ComponentProps } from "react"
5
- import {
6
- Box ,
7
- Flex ,
8
- type FlexProps ,
9
- Heading ,
10
- type HeadingProps ,
11
- ListItem ,
12
- UnorderedList ,
13
- } from "@chakra-ui/react"
4
+ import type { ComponentProps , HTMLAttributes } from "react"
14
5
15
6
import type { BasePageProps , ChildOnlyProp , Lang } from "@/lib/types"
16
7
17
8
import ActionCard from "@/components/ActionCard"
18
- import ButtonLink from "@/components/Buttons/ButtonLink"
19
9
import CalloutBanner from "@/components/CalloutBanner"
20
10
import Card from "@/components/Card"
21
11
import CardList from "@/components/CardList"
22
12
import EthPriceCard from "@/components/EthPriceCard"
23
13
import EthVideo from "@/components/EthVideo"
24
14
import FeedbackCard from "@/components/FeedbackCard"
25
15
import HorizontalCard from "@/components/HorizontalCard"
26
- import { Image } from "@/components/Image"
16
+ import { TwImage } from "@/components/Image"
27
17
import InfoBanner from "@/components/InfoBanner"
28
- import InlineLink from "@/components/Link"
29
18
import MainArticle from "@/components/MainArticle"
30
- import OldHeading from "@/components/OldHeading"
31
- import Text from "@/components/OldText"
32
19
import PageMetadata from "@/components/PageMetadata"
33
20
import { StandaloneQuizWidget } from "@/components/Quiz/QuizWidget"
34
21
import Translation from "@/components/Translation"
22
+ import { ButtonLink } from "@/components/ui/buttons/Button"
35
23
import { Divider } from "@/components/ui/divider"
24
+ import { Flex , VStack } from "@/components/ui/flex"
25
+ import InlineLink from "@/components/ui/Link"
26
+ import { ListItem , UnorderedList } from "@/components/ui/list"
36
27
37
28
import { cn } from "@/lib/utils/cn"
38
29
import { existsNamespace } from "@/lib/utils/existsNamespace"
@@ -46,166 +37,119 @@ import defi from "@/public/images/finance_transparent.png"
46
37
import ethereum from "@/public/images/what-is-ethereum.png"
47
38
48
39
const Page = ( props : ChildOnlyProp ) => (
49
- < Flex
50
- as = { MainArticle }
51
- direction = "column"
52
- align = "center"
53
- w = "full"
54
- my = { 0 }
55
- mx = "auto"
40
+ < MainArticle
41
+ className = "mx-auto my-0 flex w-full flex-col items-center"
56
42
{ ...props }
57
43
/>
58
44
)
59
45
60
46
const Content = ( props : ChildOnlyProp ) => (
61
- < Box w = " full" px = { 8 } py = { 4 } { ...props } />
47
+ < div className = "w- full px-8 py-4" { ...props } />
62
48
)
63
49
64
50
const GrayContainer = ( props : ChildOnlyProp ) => (
65
- < Box
66
- width = "full"
67
- py = { 16 }
68
- mt = { 8 }
69
- background = "grayBackground"
70
- boxShadow = "inset 0px 1px 0px var(--eth-colors-tableItemBoxShadow)"
51
+ < div
52
+ className = "mt-8 w-full border-t bg-background-highlight py-16 shadow-table-item-box"
71
53
{ ...props }
72
54
/>
73
55
)
74
56
75
57
const Intro = ( props : ChildOnlyProp ) => (
76
- < Box maxW = "608px" mb = { { base : 12 , sm : 16 } } { ...props } />
58
+ < div className = "mb-12 max-w-[608px] sm:mb-16" { ...props } />
77
59
)
78
60
79
61
const StyledCard = ( props : ComponentProps < typeof Card > ) => (
80
62
< Card
81
- className = "m-4 min-w-[280px] max-w-full flex-[1_0_30%] p-6 md:max-w-[46%] lg:max-w-[31%]"
63
+ className = "m-4 min-w-[280px] max-w-full flex-[1_0_30%] bg-background p-6 md:max-w-[46%] lg:max-w-[31%]"
82
64
{ ...props }
83
65
/>
84
66
)
85
67
86
68
const Slogan = ( props : ChildOnlyProp ) => (
87
- < Text
88
- textStyle = "normal"
89
- fontWeight = "normal"
90
- fontSize = "2rem"
91
- lineHeight = { 1.4 }
92
- { ...props }
93
- />
69
+ < h3 className = "mb-6 leading-xs" { ...props } />
94
70
)
95
71
96
72
const Title = ( props : ChildOnlyProp ) => (
97
- < Heading
98
- as = "h1"
99
- fontSize = "sm"
100
- lineHeight = { 1.4 }
101
- letterSpacing = "0.04em"
102
- fontWeight = "500"
103
- mb = { 4 }
104
- textTransform = "uppercase"
105
- color = "textTableOfContents"
73
+ < h1
74
+ className = "mb-4 mt-0 text-md font-normal uppercase !leading-xs"
106
75
{ ...props }
107
76
/>
108
77
)
109
78
110
79
const Subtitle = ( props : ChildOnlyProp ) => (
111
- < Text fontSize = "xl" lineHeight = { 1.4 } color = "text200" { ...props } />
80
+ < Text className = "mb-0 leading-xs text-body-medium" { ...props } />
81
+ )
82
+
83
+ const Text = ( { className, ...props } : HTMLAttributes < HTMLHeadingElement > ) => (
84
+ < p className = { cn ( "mb-6" , className ) } { ...props } />
112
85
)
113
86
114
- export const TwoColumnContent = ( props : FlexProps ) => (
87
+ export const TwoColumnContent = ( {
88
+ className,
89
+ ...props
90
+ } : HTMLAttributes < HTMLHeadingElement > ) => (
115
91
< Flex
116
- w = "full"
117
- direction = { { base : "column" , lg : "row" } }
118
- justify = "space-between"
119
- p = { 8 }
120
- mb = { 12 }
92
+ className = { cn (
93
+ "mb-12 w-full flex-col justify-between p-8 lg:flex-row" ,
94
+ className
95
+ ) }
121
96
{ ...props }
122
97
/>
123
98
)
124
99
125
100
export const LeftColumn = ( props : ChildOnlyProp ) => (
126
- < Box
127
- flex = "0 0 50%"
128
- maxW = { { base : "full" , lg : "75%" } }
129
- me = { { lg : 16 } }
101
+ < div
102
+ className = "max-w-full flex-none basis-1/2 lg:me-16 lg:max-w-[75%]"
130
103
{ ...props }
131
104
/>
132
105
)
133
106
134
107
export const RightColumn = ( props : ChildOnlyProp ) => (
135
108
< Flex
136
- flex = "0 1 50%"
137
- direction = "column"
138
- justify = "center"
139
- maxW = { { base : "full" , lg : "75%" } }
140
- mt = { { base : 12 , lg : 0 } }
109
+ className = "mt-12 max-w-full flex-shrink flex-grow-0 basis-1/2 flex-col justify-center lg:mt-0 lg:max-w-[75%]"
141
110
{ ...props }
142
111
/>
143
112
)
144
113
145
114
const SubtitleTwo = ( props : ChildOnlyProp ) => (
146
- < Text fontSize = "xl" lineHeight = { 1.4 } color = "text300" mb = { 8 } { ...props } />
115
+ < Text className = "mb-8 leading-xs text-body-menu-medium" { ...props } />
147
116
)
148
117
149
118
const HeroContainer = ( props : ChildOnlyProp ) => (
150
119
< Flex
151
- align = "center"
152
- justify = "space-between"
153
- direction = { { base : "column-reverse" , md : "row" } }
120
+ className = "flex-col-reverse items-center justify-between md:flex-row"
154
121
{ ...props }
155
122
/>
156
123
)
157
124
158
125
const Hero = ( props : ChildOnlyProp ) => (
159
- < Box
160
- flex = "1 1 100%"
161
- maxW = "800px"
162
- bgSize = "cover"
163
- bgRepeat = "no-repeat"
164
- ms = { { base : 0 , md : 8 } }
126
+ < div
127
+ className = "ms-0 max-w-[800px] flex-1 basis-full bg-cover bg-no-repeat md:ms-8"
165
128
{ ...props }
166
129
/>
167
130
)
168
131
169
132
const Header = ( props : ChildOnlyProp ) => (
170
- < Box
171
- as = "header"
172
- flex = "1 1 50%"
173
- minW = "300px"
174
- mt = { { base : 6 , md : 32 } }
175
- { ...props }
176
- />
133
+ < div className = "mt-6 min-w-[300px] flex-1 basis-1/2 md:mt-32" { ...props } />
177
134
)
178
135
179
- const H2 = ( prop : HeadingProps ) => (
180
- < OldHeading
181
- fontSize = { { base : "2xl" , md : "2rem" } }
182
- lineHeight = { 1.4 }
183
- mt = { 0 }
184
- { ...prop }
185
- />
136
+ const H2 = ( props : ChildOnlyProp ) => (
137
+ < h2 className = "mb-8 mt-0 leading-xs" { ...props } />
186
138
)
187
139
188
- const H3 = ( props : HeadingProps ) => (
189
- < OldHeading
190
- as = "h3"
191
- fontSize = { { base : "xl" , md : "2xl" } }
192
- lineHeight = { 1.4 }
193
- { ...props }
194
- />
140
+ const H3 = ( props : ChildOnlyProp ) => (
141
+ < h3 className = "mb-8 mt-10 leading-xs" { ...props } />
195
142
)
196
143
197
- const H4 = ( props : HeadingProps ) => (
198
- < OldHeading
199
- as = "h4"
200
- fontSize = { { base : "md" , md : "xl" } }
201
- fontWeight = { 600 }
202
- lineHeight = { 1.4 }
203
- { ...props }
204
- />
144
+ const H4 = ( props : ChildOnlyProp ) => (
145
+ < h4 className = "my-8 leading-xs" { ...props } />
205
146
)
206
147
207
- const CardContainer = ( props : FlexProps ) => (
208
- < Flex wrap = "wrap" mx = { - 4 } { ...props } />
148
+ const CardContainer = ( {
149
+ className,
150
+ ...props
151
+ } : HTMLAttributes < HTMLHeadingElement > ) => (
152
+ < Flex className = { cn ( "-mx-4 flex-wrap" , className ) } { ...props } />
209
153
)
210
154
211
155
const TokenCard = ( props : ComponentProps < typeof HorizontalCard > ) => (
@@ -216,24 +160,11 @@ const TokenCard = (props: ComponentProps<typeof HorizontalCard>) => (
216
160
/>
217
161
)
218
162
const TextDivider = ( ) => (
219
- < Box
220
- w = "10%"
221
- h = "1px"
222
- bg = "searchResultBackground"
223
- my = { 8 }
224
- alignSelf = { { lg : "flex-start" } }
225
- />
163
+ < div className = "my-8 w-[10%] bg-search-background lg:items-start" />
226
164
)
227
165
228
166
const CentralColumn = ( props : ChildOnlyProp ) => (
229
- < Flex
230
- direction = "column"
231
- align = "center"
232
- maxW = "960px"
233
- my = { 16 }
234
- mx = "auto"
235
- { ...props }
236
- />
167
+ < VStack className = "mx-auto my-16 max-w-[960px]" { ...props } />
237
168
)
238
169
239
170
const CentralActionCard = ( props : ComponentProps < typeof ActionCard > ) => (
@@ -375,7 +306,7 @@ const EthPage = () => {
375
306
</ ButtonLink >
376
307
</ Header >
377
308
< Hero >
378
- < Image
309
+ < TwImage
379
310
src = { eth }
380
311
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
381
312
sizes = "(max-width: 768px) 100vw, 800px"
@@ -390,7 +321,7 @@ const EthPage = () => {
390
321
< Intro >
391
322
< Text > { t ( "page-eth-description" ) } </ Text >
392
323
</ Intro >
393
- < CardContainer mb = { 8 } >
324
+ < CardContainer className = "mb-8" >
394
325
{ benefits . map ( ( benefits , idx ) => (
395
326
< StyledCard
396
327
key = { idx }
@@ -401,7 +332,7 @@ const EthPage = () => {
401
332
) ) }
402
333
</ CardContainer >
403
334
< InfoBanner emoji = ":wave:" shouldCenter >
404
- < Text as = "b" > { t ( "page-eth-buy-some" ) } </ Text > { " " }
335
+ < b > { t ( "page-eth-buy-some" ) } </ b > { " " }
405
336
< Translation id = "page-eth:page-eth-buy-some-desc" /> { " " }
406
337
< InlineLink href = "/what-is-ethereum/" >
407
338
{ t ( "page-eth-more-on-ethereum-link" ) }
@@ -415,13 +346,13 @@ const EthPage = () => {
415
346
< H2 > { t ( "page-eth-whats-unique" ) } </ H2 >
416
347
< Text > { t ( "page-eth-whats-unique-desc" ) } </ Text >
417
348
< EthVideo />
418
- < Box >
349
+ < div >
419
350
< H4 > { t ( "page-eth-fuels" ) } </ H4 >
420
351
< Text > { t ( "page-eth-fuels-desc" ) } </ Text >
421
352
< Text > { t ( "page-eth-fuels-desc-2" ) } </ Text >
422
353
< Text >
423
354
< Translation id = "page-eth:page-eth-fuels-desc-3" /> { " " }
424
- < Text as = "strong" > { t ( "page-eth-powers-ethereum" ) } </ Text >
355
+ < b > { t ( "page-eth-powers-ethereum" ) } </ b >
425
356
{ t ( "page-eth-period" ) }
426
357
</ Text >
427
358
< Text >
@@ -430,15 +361,15 @@ const EthPage = () => {
430
361
{ t ( "page-eth-fuels-more-staking" ) }
431
362
</ InlineLink >
432
363
</ Text >
433
- </ Box >
364
+ </ div >
434
365
< CentralActionCard
435
366
href = "/what-is-ethereum/"
436
367
title = { t ( "page-eth-whats-ethereum" ) }
437
368
description = { t ( "page-eth-whats-ethereum-desc" ) }
438
369
image = { ethereum }
439
370
/>
440
371
< TextDivider />
441
- < Box >
372
+ < div >
442
373
< H4 > { t ( "page-eth-underpins" ) } </ H4 >
443
374
< Text >
444
375
< Translation id = "page-eth:page-eth-underpins-desc" />
@@ -453,9 +384,9 @@ const EthPage = () => {
453
384
< InfoBanner isWarning >
454
385
< Translation id = "page-eth:page-eth-weth" />
455
386
</ InfoBanner >
456
- </ Box >
387
+ </ div >
457
388
< TextDivider />
458
- < Box >
389
+ < div >
459
390
< H4 > { t ( "page-eth-uses" ) } </ H4 >
460
391
< Text > { t ( "page-eth-uses-desc" ) } </ Text >
461
392
< Text > { t ( "page-eth-uses-desc-2" ) } </ Text >
@@ -485,7 +416,7 @@ const EthPage = () => {
485
416
– { t ( "page-eth-uses-desc-6" ) }
486
417
</ ListItem >
487
418
</ UnorderedList >
488
- </ Box >
419
+ </ div >
489
420
< Divider />
490
421
</ CentralColumn >
491
422
< CalloutBanner
@@ -496,11 +427,11 @@ const EthPage = () => {
496
427
alt = { t ( "page-eth-cat-img-alt" ) }
497
428
imageWidth = { 300 }
498
429
>
499
- < Box >
430
+ < div >
500
431
< ButtonLink href = "/get-eth/" >
501
432
{ t ( "page-eth-get-eth-btn" ) }
502
433
</ ButtonLink >
503
- </ Box >
434
+ </ div >
504
435
</ CalloutBanner >
505
436
</ Content >
506
437
@@ -517,12 +448,12 @@ const EthPage = () => {
517
448
< CardList items = { cardListContent } />
518
449
</ RightColumn >
519
450
</ TwoColumnContent >
520
- < TwoColumnContent id = "tokens" align = "flex-start ">
451
+ < TwoColumnContent className = "items-start" id = "tokens ">
521
452
< LeftColumn >
522
453
< H3 > { t ( "page-eth-not-only-crypto" ) } </ H3 >
523
454
< Text > { t ( "page-eth-not-only-crypto-desc" ) } </ Text >
524
455
< Text > { t ( "page-eth-not-only-crypto-desc-2" ) } </ Text >
525
- < H4 fontWeight = "normal" > { t ( "page-eth-more-on-tokens" ) } </ H4 >
456
+ < H4 > { t ( "page-eth-more-on-tokens" ) } </ H4 >
526
457
< CardList items = { tokenLinks } />
527
458
</ LeftColumn >
528
459
< RightColumn >
0 commit comments