@@ -3,8 +3,8 @@ import React, { useEffect, useState } from "react"
3
3
import { graphql , PageProps } from "gatsby"
4
4
import { useTranslation } from "gatsby-plugin-react-i18next"
5
5
import { shuffle } from "lodash"
6
+ import { Box , Flex , Heading , HeadingProps , Text } from "@chakra-ui/react"
6
7
// Component imports
7
- import { Box , Flex } from "@chakra-ui/react"
8
8
import PageMetadata from "../../components/PageMetadata"
9
9
import Translation from "../../components/Translation"
10
10
import ButtonLink from "../../components/ButtonLink"
@@ -15,54 +15,54 @@ import LearningToolsCardGrid from "../../components/LearningToolsCardGrid"
15
15
// Util imports
16
16
import { getImage } from "../../utils/image"
17
17
// Type imports
18
- import { ChildOnlyProp , Context , LearningTool } from "../../types"
18
+ import type { ChildOnlyProp , Context , LearningTool } from "../../types"
19
19
20
- const StyledPage = ( props : ChildOnlyProp ) => (
20
+ const Page = ( props : ChildOnlyProp ) => (
21
21
< Flex
22
- flexDirection = "column"
23
- alignItems = "center"
24
- w = "100%"
25
- ml = "auto"
26
- mr = "auto"
27
- mb = { 16 }
22
+ direction = "column"
23
+ align = "center"
24
+ w = "full"
25
+ mx = "auto"
28
26
mt = { 16 }
27
+ mb = { 0 }
29
28
{ ...props }
30
- > </ Flex >
29
+ / >
31
30
)
32
31
33
32
const Header = ( props : ChildOnlyProp ) => (
34
33
< Flex
35
- flexDirection = "column"
36
- alignItems = "center"
34
+ as = "header"
35
+ direction = "column"
36
+ align = "center"
37
37
textAlign = "center"
38
38
maxW = "896px"
39
- p = { 0 }
40
- pl = { 8 }
41
- pr = { 8 }
39
+ py = { 0 }
40
+ px = { 8 }
42
41
{ ...props }
43
42
/>
44
43
)
45
44
46
45
const H1 = ( props : ChildOnlyProp ) => (
47
- < Flex
48
- m = { "8 0 0" }
49
- mt = { 0 }
46
+ < Heading
47
+ as = "h1"
48
+ my = { 0 }
50
49
color = "text"
51
50
fontStyle = "normal"
52
- fontFamily = { "mono" }
51
+ fontFamily = "monospace"
53
52
textTransform = "uppercase"
54
53
fontWeight = "semibold"
55
- fontSize = "4xl "
56
- lineHeight = " 1.4"
54
+ fontSize = "2rem "
55
+ lineHeight = { 1.4 }
57
56
textAlign = "center"
58
57
{ ...props }
59
58
/>
60
59
)
61
60
62
- const Subtitle = ( props : ChildOnlyProp ) => (
63
- < Flex
64
- fontSize = { "xl" }
65
- lineHeight = { "short" }
61
+ const Subtitle = ( props : HeadingProps ) => (
62
+ < Heading
63
+ fontSize = "xl"
64
+ lineHeight = { 1.4 }
65
+ fontWeight = "normal"
66
66
color = "text300"
67
67
maxW = "55ch"
68
68
mb = { 2 }
@@ -71,32 +71,26 @@ const Subtitle = (props: ChildOnlyProp) => (
71
71
/>
72
72
)
73
73
74
- const SubtitleTwo = ( props : ChildOnlyProp ) => (
75
- < Subtitle >
76
- < Box mt = { 0 } { ...props } > </ Box >
77
- </ Subtitle >
78
- )
74
+ const SubtitleTwo = ( props : ChildOnlyProp ) => < Subtitle mt = { 0 } { ...props } />
79
75
80
76
const ContentBox = ( props : ChildOnlyProp ) => (
81
- < Box pt = { 4 } pb = { 4 } pl = { 8 } pr = { 8 } w = { "100%" } { ...props } > </ Box >
77
+ < Box py = { 4 } px = { 8 } w = "full" { ...props } / >
82
78
)
83
79
84
80
const StackContainer = ( props : ChildOnlyProp ) => (
85
81
< Box
86
- border = "1px solid border"
82
+ border = "1px"
83
+ borderColor = "border"
87
84
justifyContent = "flex-start"
88
- borderRadius = { { base : "4px" , sm : "0" } }
89
- w = { { base : "96%" , sm : "100%" } }
90
- m = { 8 }
91
- ml = { { base : 8 , sm : 0 } }
92
- mr = { { base : 8 , sm : 0 } }
93
- pt = { 12 }
94
- pb = { 12 }
95
- pl = { 8 }
96
- pr = { 8 }
85
+ borderRadius = { { base : 0 , sm : "base" } }
86
+ w = { { base : "full" , sm : "96%" } }
87
+ mx = { { base : 0 , sm : 8 } }
88
+ my = { 8 }
89
+ px = { 8 }
90
+ py = { 12 }
97
91
background = "ednBackground"
98
92
{ ...props }
99
- > </ Box >
93
+ / >
100
94
)
101
95
102
96
// Page component
@@ -285,7 +279,7 @@ const LearningToolsPage = ({
285
279
]
286
280
287
281
return (
288
- < StyledPage >
282
+ < Page >
289
283
< PageMetadata
290
284
title = { t ( "page-learning-tools-meta-title" ) }
291
285
description = { t ( "page-learning-tools-meta-desc" ) }
@@ -302,9 +296,9 @@ const LearningToolsPage = ({
302
296
< SubtitleTwo >
303
297
< Translation id = "page-learning-tools-sandbox" />
304
298
</ SubtitleTwo >
305
- < p >
299
+ < Text >
306
300
< Translation id = "page-learning-tools-sandbox-desc" />
307
- </ p >
301
+ </ Text >
308
302
< LearningToolsCardGrid category = { randomizedSandboxes } />
309
303
< InfoBanner emoji = ":point_up:" shouldCenter >
310
304
< Translation id = "page-learning-tools-remix-description-2" />
@@ -314,18 +308,18 @@ const LearningToolsPage = ({
314
308
< SubtitleTwo >
315
309
< Translation id = "page-learning-tools-game-tutorials" />
316
310
</ SubtitleTwo >
317
- < p >
311
+ < Text >
318
312
< Translation id = "page-learning-tools-game-tutorials-desc" />
319
- </ p >
313
+ </ Text >
320
314
< LearningToolsCardGrid category = { games } />
321
315
</ StackContainer >
322
316
< StackContainer >
323
317
< SubtitleTwo >
324
318
< Translation id = "page-learning-tools-bootcamps" />
325
319
</ SubtitleTwo >
326
- < p >
320
+ < Text >
327
321
< Translation id = "page-learning-tools-bootcamps-desc" />
328
- </ p >
322
+ </ Text >
329
323
< LearningToolsCardGrid category = { bootcamps } />
330
324
</ StackContainer >
331
325
< ContentBox >
@@ -338,17 +332,17 @@ const LearningToolsPage = ({
338
332
titleKey = { "page-learning-tools-documentation" }
339
333
descriptionKey = { "page-learning-tools-documentation-desc" }
340
334
>
341
- < div >
335
+ < Box >
342
336
< ButtonLink to = "/developers/docs/" >
343
337
< Translation id = "page-learning-tools-browse-docs" />
344
338
</ ButtonLink >
345
- </ div >
339
+ </ Box >
346
340
</ CalloutBanner >
347
341
</ ContentBox >
348
342
< ContentBox >
349
343
< FeedbackCard />
350
344
</ ContentBox >
351
- </ StyledPage >
345
+ </ Page >
352
346
)
353
347
}
354
348
0 commit comments