1
+ import { BaseHTMLAttributes } from "react"
1
2
import shuffle from "lodash/shuffle"
2
3
import { GetStaticProps } from "next"
3
4
import { useTranslation } from "next-i18next"
4
5
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
5
- import { Box , Flex , HeadingProps } from "@chakra-ui/react"
6
6
7
- import { BasePageProps , ChildOnlyProp , Lang , LearningTool } from "@/lib/types"
7
+ import { BasePageProps , Lang , LearningTool } from "@/lib/types"
8
8
9
9
import ButtonLink from "@/components/Buttons/ButtonLink"
10
10
import CalloutBanner from "@/components/CalloutBanner"
11
11
import FeedbackCard from "@/components/FeedbackCard"
12
12
import InfoBanner from "@/components/InfoBanner"
13
13
import LearningToolsCardGrid from "@/components/LearningToolsCardGrid"
14
14
import MainArticle from "@/components/MainArticle"
15
- import Heading from "@/components/OldHeading"
16
- import Text from "@/components/OldText"
17
15
import PageMetadata from "@/components/PageMetadata"
18
16
import Translation from "@/components/Translation"
19
17
18
+ import { cn } from "@/lib/utils/cn"
20
19
import { existsNamespace } from "@/lib/utils/existsNamespace"
21
20
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
22
21
import { getLocaleTimestamp } from "@/lib/utils/time"
@@ -45,77 +44,75 @@ import SpeedRunEthereumImage from "@/public/images/dev-tools/speed-run-ethereum.
45
44
import TenderlyImage from "@/public/images/dev-tools/tenderly.png"
46
45
import EnterpriseEth from "@/public/images/enterprise-eth.png"
47
46
48
- const Page = ( props : ChildOnlyProp ) => (
49
- < Flex
50
- direction = "column"
51
- align = "center"
52
- w = "full"
53
- mx = "auto"
54
- mt = { 16 }
55
- mb = { 0 }
47
+ const Page = ( { className, ...props } : BaseHTMLAttributes < HTMLDivElement > ) => (
48
+ < div
49
+ className = { cn (
50
+ "mx-auto mb-0 mt-16 flex w-full flex-col items-center" ,
51
+ className
52
+ ) }
56
53
{ ...props }
57
54
/>
58
55
)
59
56
60
- const Header = ( props : ChildOnlyProp ) => (
61
- < Flex
62
- as = "header"
63
- direction = "column"
64
- align = "center"
65
- textAlign = "center"
66
- maxW = "896px"
67
- py = { 0 }
68
- px = { 8 }
69
- m = "auto"
57
+ const Header = ( { className, ...props } : BaseHTMLAttributes < HTMLElement > ) => (
58
+ < header
59
+ className = { cn (
60
+ "m-auto flex max-w-[896px] flex-col items-center px-8 py-0 text-center" ,
61
+ className
62
+ ) }
70
63
{ ...props }
71
64
/>
72
65
)
73
66
74
- const H1 = ( props : ChildOnlyProp ) => (
75
- < Heading
76
- as = "h1"
77
- color = "text"
78
- fontStyle = "normal"
79
- fontFamily = "monospace"
80
- textTransform = "uppercase"
81
- fontWeight = "semibold"
82
- fontSize = "2rem"
83
- lineHeight = { 1.4 }
84
- textAlign = "center"
67
+ const H1 = ( {
68
+ className,
69
+ ...props
70
+ } : BaseHTMLAttributes < HTMLHeadingElement > ) => (
71
+ < h1
72
+ className = { cn (
73
+ "my-8 text-center font-mono text-3xl font-semibold uppercase leading-[1.4]" ,
74
+ className
75
+ ) }
85
76
{ ...props }
86
77
/>
87
78
)
88
79
89
- const Subtitle = ( props : HeadingProps ) => (
90
- < Heading
91
- fontSize = "xl"
92
- lineHeight = { 1.4 }
93
- fontWeight = "normal"
94
- color = "text300"
95
- maxW = " 55ch"
96
- mb = { 2 }
97
- mt = { 4 }
80
+ const Subtitle = ( {
81
+ className ,
82
+ ... props
83
+ } : BaseHTMLAttributes < HTMLHeadingElement > ) => (
84
+ < h2
85
+ className = { cn (
86
+ "text-text300 mb-2 mt-4 max-w-[ 55ch] text-xl font-normal leading-[1.4]" ,
87
+ className
88
+ ) }
98
89
{ ...props }
99
90
/>
100
91
)
101
92
102
- const SubtitleTwo = ( props : ChildOnlyProp ) => < Subtitle mt = { 0 } { ...props } />
93
+ const SubtitleTwo = ( {
94
+ className,
95
+ ...props
96
+ } : BaseHTMLAttributes < HTMLHeadingElement > ) => (
97
+ < Subtitle className = { cn ( "mt-0" , className ) } { ...props } />
98
+ )
103
99
104
- const ContentBox = ( props : ChildOnlyProp ) => (
105
- < Box py = { 4 } px = { 8 } w = "full" { ...props } />
100
+ const ContentBox = ( {
101
+ className,
102
+ ...props
103
+ } : BaseHTMLAttributes < HTMLDivElement > ) => (
104
+ < div className = { cn ( "w-full px-8 py-4" , className ) } { ...props } />
106
105
)
107
106
108
- const StackContainer = ( props : ChildOnlyProp ) => (
109
- < Box
110
- border = "1px"
111
- borderColor = "border"
112
- borderRadius = { { base : 0 , sm : "base" } }
113
- w = { { base : "full" , sm : "96%" } }
114
- mx = { { base : 0 , sm : 8 } }
115
- my = { 8 }
116
- px = { 8 }
117
- py = { 12 }
118
- background = "ednBackground"
107
+ const StackContainer = ( {
108
+ className,
109
+ ...props
110
+ } : BaseHTMLAttributes < HTMLDivElement > ) => (
111
+ < div
112
+ className = { cn (
113
+ "mx-0 my-8 w-full border bg-background-highlight px-8 py-12 sm:mx-8 sm:w-[96%] sm:rounded" ,
114
+ className
115
+ ) }
119
116
{ ...props }
120
117
/>
121
118
)
@@ -439,7 +436,7 @@ const LearningToolsPage = () => {
439
436
) }
440
437
/>
441
438
< MainArticle className = "w-full" >
442
- < Box w = " full">
439
+ < div className = "w- full">
443
440
< Header >
444
441
< H1 >
445
442
< Translation id = "page-developers-learning-tools:page-learning-tools-coding" />
@@ -448,14 +445,14 @@ const LearningToolsPage = () => {
448
445
< Translation id = "page-developers-learning-tools:page-learning-tools-coding-subtitle" />
449
446
</ Subtitle >
450
447
</ Header >
451
- </ Box >
448
+ </ div >
452
449
< StackContainer >
453
450
< SubtitleTwo >
454
451
< Translation id = "page-developers-learning-tools:page-learning-tools-sandbox" />
455
452
</ SubtitleTwo >
456
- < Text >
453
+ < p >
457
454
< Translation id = "page-developers-learning-tools:page-learning-tools-sandbox-desc" />
458
- </ Text >
455
+ </ p >
459
456
< LearningToolsCardGrid category = { randomizedSandboxes } />
460
457
< InfoBanner emoji = ":point_up:" shouldCenter >
461
458
< Translation id = "page-developers-learning-tools:page-learning-tools-remix-description-2" />
@@ -465,18 +462,18 @@ const LearningToolsPage = () => {
465
462
< SubtitleTwo >
466
463
< Translation id = "page-developers-learning-tools:page-learning-tools-game-tutorials" />
467
464
</ SubtitleTwo >
468
- < Text >
465
+ < p >
469
466
< Translation id = "page-developers-learning-tools:page-learning-tools-game-tutorials-desc" />
470
- </ Text >
467
+ </ p >
471
468
< LearningToolsCardGrid category = { games } />
472
469
</ StackContainer >
473
470
< StackContainer >
474
471
< SubtitleTwo >
475
472
< Translation id = "page-developers-learning-tools:page-learning-tools-bootcamps" />
476
473
</ SubtitleTwo >
477
- < Text >
474
+ < p >
478
475
< Translation id = "page-developers-learning-tools:page-learning-tools-bootcamps-desc" />
479
- </ Text >
476
+ </ p >
480
477
< LearningToolsCardGrid category = { bootcamps } />
481
478
</ StackContainer >
482
479
< ContentBox >
@@ -493,13 +490,14 @@ const LearningToolsPage = () => {
493
490
"page-developers-learning-tools:page-learning-tools-documentation-desc"
494
491
}
495
492
>
496
- < Box >
493
+ < div >
497
494
< ButtonLink href = "/developers/docs/" >
498
495
< Translation id = "page-developers-learning-tools:page-learning-tools-browse-docs" />
499
496
</ ButtonLink >
500
- </ Box >
497
+ </ div >
501
498
</ CalloutBanner >
502
499
</ ContentBox >
500
+
503
501
< ContentBox >
504
502
< FeedbackCard />
505
503
</ ContentBox >
0 commit comments