1
1
// Library imports
2
2
import React , { useEffect , useState } from "react"
3
- import styled from "@emotion/styled"
4
3
import { graphql , PageProps } from "gatsby"
5
4
import { useTranslation } from "gatsby-plugin-react-i18next"
6
5
import { shuffle } from "lodash"
7
6
// 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"
11
11
import InfoBanner from "../../components/InfoBanner"
12
12
import CalloutBanner from "../../components/CalloutBanner"
13
- import { Content , Page } from "../../components/SharedStyledComponents"
14
13
import FeedbackCard from "../../components/FeedbackCard"
15
14
import LearningToolsCardGrid from "../../components/LearningToolsCardGrid"
16
15
// Util imports
17
16
import { getImage } from "../../utils/image"
18
17
// Type imports
19
- import { Context , LearningTool } from "../../types"
18
+ import { ChildOnlyProp , Context , LearningTool } from "../../types"
20
19
21
- // Styled components
22
- const StyledPage = styled ( Page ) `
23
- margin-top: 4rem;
24
- `
20
+ const StyledPage = ( props : ChildOnlyProp ) => (
21
+ < Flex
22
+ flexDirection = "column"
23
+ alignItems = "center"
24
+ w = "100%"
25
+ ml = "auto"
26
+ mr = "auto"
27
+ mb = { 16 }
28
+ mt = { 16 }
29
+ { ...props }
30
+ > </ Flex >
31
+ )
25
32
26
- const Header = styled . header `
27
- display: flex;
28
- flex-direction: column;
29
- align-items: center;
30
- text-align: center;
31
- max-width: 896px;
32
- padding: 0 2rem;
33
- `
34
- const H1 = styled . h1 `
35
- margin: 2rem 0 0;
36
- margin-top: 0;
37
- color: ${ ( props ) => props . theme . colors . text } ;
38
- font-style: normal;
39
- font-family: ${ ( props ) => props . theme . fonts . monospace } ;
40
- text-transform: uppercase;
41
- font-weight: 600;
42
- font-size: 2rem;
43
- line-height: 1.4;
44
- text-align: center;
45
- `
33
+ const Header = ( props : ChildOnlyProp ) => (
34
+ < Flex
35
+ flexDirection = "column"
36
+ alignItems = "center"
37
+ textAlign = "center"
38
+ maxW = "896px"
39
+ p = { 0 }
40
+ pl = { 8 }
41
+ pr = { 8 }
42
+ { ...props }
43
+ />
44
+ )
46
45
47
- const Subtitle = styled . h2 `
48
- font-size: 1.25rem;
49
- line-height: 1.4;
50
- font-weight: 400;
51
- color: ${ ( props ) => props . theme . colors . text300 } ;
52
- max-width: 55ch;
53
- margin-bottom: 0.5rem;
54
- margin-top: 1rem;
55
- `
46
+ const H1 = ( props : ChildOnlyProp ) => (
47
+ < Flex
48
+ m = { "8 0 0" }
49
+ mt = { 0 }
50
+ color = "text"
51
+ fontStyle = "normal"
52
+ fontFamily = { "mono" }
53
+ textTransform = "uppercase"
54
+ fontWeight = "semibold"
55
+ fontSize = "4xl"
56
+ lineHeight = "1.4"
57
+ textAlign = "center"
58
+ { ...props }
59
+ />
60
+ )
56
61
57
- const SubtitleTwo = styled ( Subtitle ) `
58
- margin-top: 0rem;
59
- `
62
+ const Subtitle = ( props : ChildOnlyProp ) => (
63
+ < Flex
64
+ fontSize = { "xl" }
65
+ lineHeight = { "short" }
66
+ color = "text300"
67
+ maxW = "55ch"
68
+ mb = { 2 }
69
+ mt = { 4 }
70
+ { ...props }
71
+ />
72
+ )
60
73
61
- const StackContainer = styled ( Content ) `
62
- border: 1px solid ${ ( props ) => props . theme . colors . border } ;
63
- justify-content: flex-start;
64
- border-radius: 4px;
65
- padding: 3rem 2rem;
66
- margin: 2rem;
67
- width: 96%;
68
- background: ${ ( props ) => props . theme . colors . ednBackground } ;
69
- @media (max-width: ${ ( props ) => props . theme . breakpoints . s } ) {
70
- width: 100%;
71
- margin-left: 0rem;
72
- margin-right: 0rem;
73
- border-radius: 0px;
74
- }
75
- `
74
+ const SubtitleTwo = ( props : ChildOnlyProp ) => (
75
+ < Subtitle >
76
+ < Box mt = { 0 } { ...props } > </ Box >
77
+ </ Subtitle >
78
+ )
79
+
80
+ const ContentBox = ( props : ChildOnlyProp ) => (
81
+ < Box pt = { 4 } pb = { 4 } pl = { 8 } pr = { 8 } w = { "100%" } { ...props } > </ Box >
82
+ )
83
+
84
+ const StackContainer = ( props : ChildOnlyProp ) => (
85
+ < Box
86
+ border = "1px solid border"
87
+ 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 }
97
+ background = "ednBackground"
98
+ { ...props }
99
+ > </ Box >
100
+ )
76
101
77
102
// Page component
78
103
const LearningToolsPage = ( {
@@ -303,7 +328,7 @@ const LearningToolsPage = ({
303
328
</ p >
304
329
< LearningToolsCardGrid category = { bootcamps } />
305
330
</ StackContainer >
306
- < Content >
331
+ < ContentBox >
307
332
< CalloutBanner
308
333
mx = { 4 }
309
334
mt = { 24 }
@@ -319,10 +344,10 @@ const LearningToolsPage = ({
319
344
</ ButtonLink >
320
345
</ div >
321
346
</ CalloutBanner >
322
- </ Content >
323
- < Content >
347
+ </ ContentBox >
348
+ < ContentBox >
324
349
< FeedbackCard />
325
- </ Content >
350
+ </ ContentBox >
326
351
</ StyledPage >
327
352
)
328
353
}
0 commit comments