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"
15
+ import Heading from "@/components/Heading"
25
16
import HorizontalCard from "@/components/HorizontalCard"
26
- import { Image } from "@/components/Image"
17
+ import { TwImage } from "@/components/Image"
27
18
import InfoBanner from "@/components/InfoBanner"
28
- import InlineLink from "@/components/Link"
29
19
import MainArticle from "@/components/MainArticle"
30
- import OldHeading from "@/components/OldHeading"
31
- import Text from "@/components/OldText"
32
20
import PageMetadata from "@/components/PageMetadata"
33
21
import { StandaloneQuizWidget } from "@/components/Quiz/QuizWidget"
34
22
import Translation from "@/components/Translation"
23
+ import { ButtonLink } from "@/components/ui/buttons/Button"
35
24
import { Divider } from "@/components/ui/divider"
25
+ import { Flex , VStack } from "@/components/ui/flex"
26
+ import InlineLink from "@/components/ui/Link"
27
+ import { ListItem , UnorderedList } from "@/components/ui/list"
36
28
37
29
import { cn } from "@/lib/utils/cn"
38
30
import { existsNamespace } from "@/lib/utils/existsNamespace"
@@ -46,34 +38,25 @@ import defi from "@/public/images/finance_transparent.png"
46
38
import ethereum from "@/public/images/what-is-ethereum.png"
47
39
48
40
const Page = ( props : ChildOnlyProp ) => (
49
- < Flex
50
- as = { MainArticle }
51
- direction = "column"
52
- align = "center"
53
- w = "full"
54
- my = { 0 }
55
- mx = "auto"
41
+ < MainArticle
42
+ className = "mx-auto my-0 flex w-full flex-col items-center"
56
43
{ ...props }
57
44
/>
58
45
)
59
46
60
47
const Content = ( props : ChildOnlyProp ) => (
61
- < Box w = " full" px = { 8 } py = { 4 } { ...props } />
48
+ < div className = "w- full px-8 py-4" { ...props } />
62
49
)
63
50
64
51
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)"
52
+ < div
53
+ className = "mt-8 w-full border-t bg-background-highlight py-16 shadow-table-item-box"
71
54
{ ...props }
72
55
/>
73
56
)
74
57
75
58
const Intro = ( props : ChildOnlyProp ) => (
76
- < Box maxW = "608px" mb = { { base : 12 , sm : 16 } } { ...props } />
59
+ < div className = "mb-12 max-w-[608px] sm:mb-16" { ...props } />
77
60
)
78
61
79
62
const StyledCard = ( props : ComponentProps < typeof Card > ) => (
@@ -88,13 +71,7 @@ const StyledCard = (props: ComponentProps<typeof Card>) => (
88
71
)
89
72
90
73
const Slogan = ( props : ChildOnlyProp ) => (
91
- < Text
92
- textStyle = "normal"
93
- fontWeight = "normal"
94
- fontSize = "2rem"
95
- lineHeight = { 1.4 }
96
- { ...props }
97
- />
74
+ < h3 className = "mb-6 leading-xs" { ...props } />
98
75
)
99
76
100
77
const Title = ( props : ChildOnlyProp ) => (
@@ -112,104 +89,79 @@ const Title = (props: ChildOnlyProp) => (
112
89
)
113
90
114
91
const Subtitle = ( props : ChildOnlyProp ) => (
115
- < Text fontSize = "xl" lineHeight = { 1.4 } color = "text200" { ...props } />
92
+ < Text className = "leading-xs text-body-medium" { ...props } />
93
+ )
94
+
95
+ const Text = ( { className, ...props } : HTMLAttributes < HTMLHeadingElement > ) => (
96
+ < p className = { cn ( "mb-6" , className ) } { ...props } />
116
97
)
117
98
118
- export const TwoColumnContent = ( props : FlexProps ) => (
99
+ export const TwoColumnContent = ( {
100
+ className,
101
+ ...props
102
+ } : HTMLAttributes < HTMLHeadingElement > ) => (
119
103
< Flex
120
- w = "full"
121
- direction = { { base : "column" , lg : "row" } }
122
- justify = "space-between"
123
- p = { 8 }
124
- mb = { 12 }
104
+ className = { cn (
105
+ "mb-12 w-full flex-col justify-between p-8 lg:flex-row" ,
106
+ className
107
+ ) }
125
108
{ ...props }
126
109
/>
127
110
)
128
111
129
112
export const LeftColumn = ( props : ChildOnlyProp ) => (
130
- < Box
131
- flex = "0 0 50%"
132
- maxW = { { base : "full" , lg : "75%" } }
133
- me = { { lg : 16 } }
113
+ < div
114
+ className = "max-w-full flex-none basis-1/2 lg:me-16 lg:max-w-[75%]"
134
115
{ ...props }
135
116
/>
136
117
)
137
118
138
119
export const RightColumn = ( props : ChildOnlyProp ) => (
139
120
< Flex
140
- flex = "0 1 50%"
141
- direction = "column"
142
- justify = "center"
143
- maxW = { { base : "full" , lg : "75%" } }
144
- mt = { { base : 12 , lg : 0 } }
121
+ 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%]"
145
122
{ ...props }
146
123
/>
147
124
)
148
125
149
126
const SubtitleTwo = ( props : ChildOnlyProp ) => (
150
- < Text fontSize = "xl" lineHeight = { 1.4 } color = "text300" mb = { 8 } { ...props } />
127
+ < Text className = "mb-8 leading-xs text-body-menu-medium" { ...props } />
151
128
)
152
129
153
130
const HeroContainer = ( props : ChildOnlyProp ) => (
154
131
< Flex
155
- align = "center"
156
- justify = "space-between"
157
- direction = { { base : "column-reverse" , md : "row" } }
132
+ className = "flex-col-reverse items-center justify-between md:flex-row"
158
133
{ ...props }
159
134
/>
160
135
)
161
136
162
137
const Hero = ( props : ChildOnlyProp ) => (
163
- < Box
164
- flex = "1 1 100%"
165
- maxW = "800px"
166
- bgSize = "cover"
167
- bgRepeat = "no-repeat"
168
- ms = { { base : 0 , md : 8 } }
138
+ < div
139
+ className = "ms-0 max-w-[800px] flex-1 basis-full bg-cover bg-no-repeat md:ms-8"
169
140
{ ...props }
170
141
/>
171
142
)
172
143
173
144
const Header = ( props : ChildOnlyProp ) => (
174
- < Box
175
- as = "header"
176
- flex = "1 1 50%"
177
- minW = "300px"
178
- mt = { { base : 6 , md : 32 } }
179
- { ...props }
180
- />
145
+ < div className = "mt-6 min-w-[300px] flex-1 basis-1/2 md:mt-32" { ...props } />
181
146
)
182
147
183
- const H2 = ( prop : HeadingProps ) => (
184
- < OldHeading
185
- fontSize = { { base : "2xl" , md : "2rem" } }
186
- lineHeight = { 1.4 }
187
- mt = { 0 }
188
- { ...prop }
189
- />
148
+ const H2 = ( props : ChildOnlyProp ) => (
149
+ < h2 className = "mb-8 mt-0 leading-xs" { ...props } />
190
150
)
191
151
192
- const H3 = ( props : HeadingProps ) => (
193
- < OldHeading
194
- as = "h3"
195
- fontSize = { { base : "xl" , md : "2xl" } }
196
- lineHeight = { 1.4 }
197
- { ...props }
198
- />
152
+ const H3 = ( props : ChildOnlyProp ) => (
153
+ < h3 className = "mb-8 mt-10 leading-xs" { ...props } />
199
154
)
200
155
201
- const H4 = ( props : HeadingProps ) => (
202
- < OldHeading
203
- as = "h4"
204
- fontSize = { { base : "md" , md : "xl" } }
205
- fontWeight = { 600 }
206
- lineHeight = { 1.4 }
207
- { ...props }
208
- />
156
+ const H4 = ( props : ChildOnlyProp ) => (
157
+ < h4 className = "my-8 leading-xs" { ...props } />
209
158
)
210
159
211
- const CardContainer = ( props : FlexProps ) => (
212
- < Flex wrap = "wrap" mx = { - 4 } { ...props } />
160
+ const CardContainer = ( {
161
+ className,
162
+ ...props
163
+ } : HTMLAttributes < HTMLHeadingElement > ) => (
164
+ < Flex className = { cn ( "-mx-4 flex-wrap" , className ) } { ...props } />
213
165
)
214
166
215
167
const TokenCard = ( props : ComponentProps < typeof HorizontalCard > ) => (
@@ -220,24 +172,11 @@ const TokenCard = (props: ComponentProps<typeof HorizontalCard>) => (
220
172
/>
221
173
)
222
174
const TextDivider = ( ) => (
223
- < Box
224
- w = "10%"
225
- h = "1px"
226
- bg = "searchResultBackground"
227
- my = { 8 }
228
- alignSelf = { { lg : "flex-start" } }
229
- />
175
+ < div className = "my-8 w-[10%] bg-search-background lg:items-start" />
230
176
)
231
177
232
178
const CentralColumn = ( props : ChildOnlyProp ) => (
233
- < Flex
234
- direction = "column"
235
- align = "center"
236
- maxW = "960px"
237
- my = { 16 }
238
- mx = "auto"
239
- { ...props }
240
- />
179
+ < VStack className = "mx-auto my-16 max-w-[960px]" { ...props } />
241
180
)
242
181
243
182
const CentralActionCard = ( props : ComponentProps < typeof ActionCard > ) => (
@@ -379,7 +318,7 @@ const EthPage = () => {
379
318
</ ButtonLink >
380
319
</ Header >
381
320
< Hero >
382
- < Image
321
+ < TwImage
383
322
src = { eth }
384
323
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
385
324
sizes = "(max-width: 768px) 100vw, 800px"
@@ -394,7 +333,7 @@ const EthPage = () => {
394
333
< Intro >
395
334
< Text > { t ( "page-eth-description" ) } </ Text >
396
335
</ Intro >
397
- < CardContainer mb = { 8 } >
336
+ < CardContainer className = "mb-8" >
398
337
{ benefits . map ( ( benefits , idx ) => (
399
338
< StyledCard
400
339
key = { idx }
@@ -405,7 +344,7 @@ const EthPage = () => {
405
344
) ) }
406
345
</ CardContainer >
407
346
< InfoBanner emoji = ":wave:" shouldCenter >
408
- < Text as = "b" > { t ( "page-eth-buy-some" ) } </ Text > { " " }
347
+ < b > { t ( "page-eth-buy-some" ) } </ b > { " " }
409
348
< Translation id = "page-eth:page-eth-buy-some-desc" /> { " " }
410
349
< InlineLink href = "/what-is-ethereum/" >
411
350
{ t ( "page-eth-more-on-ethereum-link" ) }
@@ -419,13 +358,13 @@ const EthPage = () => {
419
358
< H2 > { t ( "page-eth-whats-unique" ) } </ H2 >
420
359
< Text > { t ( "page-eth-whats-unique-desc" ) } </ Text >
421
360
< EthVideo />
422
- < Box >
361
+ < div >
423
362
< H4 > { t ( "page-eth-fuels" ) } </ H4 >
424
363
< Text > { t ( "page-eth-fuels-desc" ) } </ Text >
425
364
< Text > { t ( "page-eth-fuels-desc-2" ) } </ Text >
426
365
< Text >
427
366
< Translation id = "page-eth:page-eth-fuels-desc-3" /> { " " }
428
- < Text as = "strong" > { t ( "page-eth-powers-ethereum" ) } </ Text >
367
+ < b > { t ( "page-eth-powers-ethereum" ) } </ b >
429
368
{ t ( "page-eth-period" ) }
430
369
</ Text >
431
370
< Text >
@@ -434,15 +373,15 @@ const EthPage = () => {
434
373
{ t ( "page-eth-fuels-more-staking" ) }
435
374
</ InlineLink >
436
375
</ Text >
437
- </ Box >
376
+ </ div >
438
377
< CentralActionCard
439
378
href = "/what-is-ethereum/"
440
379
title = { t ( "page-eth-whats-ethereum" ) }
441
380
description = { t ( "page-eth-whats-ethereum-desc" ) }
442
381
image = { ethereum }
443
382
/>
444
383
< TextDivider />
445
- < Box >
384
+ < div >
446
385
< H4 > { t ( "page-eth-underpins" ) } </ H4 >
447
386
< Text >
448
387
< Translation id = "page-eth:page-eth-underpins-desc" />
@@ -457,9 +396,9 @@ const EthPage = () => {
457
396
< InfoBanner isWarning >
458
397
< Translation id = "page-eth:page-eth-weth" />
459
398
</ InfoBanner >
460
- </ Box >
399
+ </ div >
461
400
< TextDivider />
462
- < Box >
401
+ < div >
463
402
< H4 > { t ( "page-eth-uses" ) } </ H4 >
464
403
< Text > { t ( "page-eth-uses-desc" ) } </ Text >
465
404
< Text > { t ( "page-eth-uses-desc-2" ) } </ Text >
@@ -489,7 +428,7 @@ const EthPage = () => {
489
428
– { t ( "page-eth-uses-desc-6" ) }
490
429
</ ListItem >
491
430
</ UnorderedList >
492
- </ Box >
431
+ </ div >
493
432
< Divider />
494
433
</ CentralColumn >
495
434
< CalloutBanner
@@ -500,11 +439,11 @@ const EthPage = () => {
500
439
alt = { t ( "page-eth-cat-img-alt" ) }
501
440
imageWidth = { 300 }
502
441
>
503
- < Box >
442
+ < div >
504
443
< ButtonLink href = "/get-eth/" >
505
444
{ t ( "page-eth-get-eth-btn" ) }
506
445
</ ButtonLink >
507
- </ Box >
446
+ </ div >
508
447
</ CalloutBanner >
509
448
</ Content >
510
449
@@ -521,12 +460,12 @@ const EthPage = () => {
521
460
< CardList items = { cardListContent } />
522
461
</ RightColumn >
523
462
</ TwoColumnContent >
524
- < TwoColumnContent id = "tokens" align = "flex-start ">
463
+ < TwoColumnContent className = "items-start" id = "tokens ">
525
464
< LeftColumn >
526
465
< H3 > { t ( "page-eth-not-only-crypto" ) } </ H3 >
527
466
< Text > { t ( "page-eth-not-only-crypto-desc" ) } </ Text >
528
467
< Text > { t ( "page-eth-not-only-crypto-desc-2" ) } </ Text >
529
- < H4 fontWeight = "normal" > { t ( "page-eth-more-on-tokens" ) } </ H4 >
468
+ < H4 > { t ( "page-eth-more-on-tokens" ) } </ H4 >
530
469
< CardList items = { tokenLinks } />
531
470
</ LeftColumn >
532
471
< RightColumn >
0 commit comments