1
1
import React , { useState } from "react"
2
- import styled from "@emotion/styled"
3
2
import { useTranslation } from "gatsby-plugin-react-i18next"
3
+ import { Box , chakra , Flex , Text } from "@chakra-ui/react"
4
4
5
5
import { StyledSelect as Select } from "../SharedStyledComponents"
6
6
import ButtonLink from "../ButtonLink"
@@ -9,41 +9,12 @@ import Translation from "../Translation"
9
9
10
10
import { trackCustomEvent } from "../../utils/matomo"
11
11
12
- const Container = styled . div `
13
- display: flex;
14
- flex-direction: column;
15
- background: ${ ( { theme } ) => theme . colors . layer2Gradient } ;
16
- border-radius: 0.25rem;
17
- padding: 2rem;
18
- @media (max-width: ${ ( props ) => props . theme . breakpoints . m } ) {
19
- padding: 1.5rem;
20
- }
21
- span {
22
- color: ${ ( { theme } ) => theme . colors . text200 } ;
23
- }
24
- `
25
-
26
- const SelectContainer = styled . div `
27
- margin: 1rem 0;
28
- `
12
+ const StyledSelect = chakra ( Select , {
13
+ baseStyle : {
14
+ maxW : { base : "full" , md : "50%" } ,
15
+ } ,
16
+ } )
29
17
30
- const StyledSelect = styled ( Select ) `
31
- max-width: 50%;
32
- @media (max-width: ${ ( { theme } ) => theme . breakpoints . m } ) {
33
- max-width: 100%;
34
- }
35
- `
36
-
37
- const ButtonContainer = styled . div `
38
- display: flex;
39
- flex-wrap: wrap;
40
- gap: 1rem;
41
- @media (max-width: ${ ( props ) => props . theme . breakpoints . m } ) {
42
- a {
43
- width: 100%;
44
- }
45
- }
46
- `
47
18
export interface IProps { }
48
19
49
20
const StakingLaunchpadWidget : React . FC < IProps > = ( ) => {
@@ -77,44 +48,54 @@ const StakingLaunchpadWidget: React.FC<IProps> = () => {
77
48
} ) )
78
49
79
50
return (
80
- < Container >
81
- < div >
82
- < span >
83
- < Translation id = "page-staking-launchpad-widget-span" />
84
- </ span >
85
- < SelectContainer >
86
- < StyledSelect
87
- className = "react-select-container"
88
- classNamePrefix = "react-select"
89
- options = { selectOptions }
90
- onChange = { handleChange }
91
- defaultValue = { selectOptions [ 0 ] }
92
- />
93
- </ SelectContainer >
94
- < p >
95
- < Translation id = "page-staking-launchpad-widget-p1" />
96
- </ p >
97
- < p >
98
- < Translation id = "page-staking-launchpad-widget-p2" />
99
- </ p >
100
- < ButtonContainer style = { { marginBottom : "1rem" } } >
101
- < ButtonLink to = { data [ selection ] . url } >
102
- { selection === "mainnet"
103
- ? t ( "page-staking-launchpad-widget-mainnet-start" )
104
- : t ( "page-staking-launchpad-widget-testnet-start" ) }
105
- </ ButtonLink >
106
- </ ButtonContainer >
107
- < p >
108
- < Translation id = "page-staking-launchpad-widget-p3" />
109
- </ p >
110
- < ButtonContainer >
111
- < ButtonLink to = "#node-and-client-tools" variant = "outline" >
112
- < Emoji text = "🛠" mr = "1rem" />
113
- < Translation id = "page-staking-launchpad-widget-link" />
114
- </ ButtonLink >
115
- </ ButtonContainer >
116
- </ div >
117
- </ Container >
51
+ < Flex
52
+ bg = "layer2Gradient"
53
+ borderRadius = "base"
54
+ flexDir = "column"
55
+ p = { { base : 6 , md : 8 } }
56
+ >
57
+ < Text as = "span" color = "text200" >
58
+ < Translation id = "page-staking-launchpad-widget-span" />
59
+ </ Text >
60
+ < Box my = { 4 } >
61
+ < StyledSelect
62
+ className = "react-select-container"
63
+ classNamePrefix = "react-select"
64
+ options = { selectOptions }
65
+ onChange = { handleChange }
66
+ defaultValue = { selectOptions [ 0 ] }
67
+ />
68
+ </ Box >
69
+ < Text >
70
+ < Translation id = "page-staking-launchpad-widget-p1" />
71
+ </ Text >
72
+ < Text >
73
+ < Translation id = "page-staking-launchpad-widget-p2" />
74
+ </ Text >
75
+ < Box mb = { 4 } >
76
+ < ButtonLink
77
+ to = { data [ selection ] . url }
78
+ width = { { base : "full" , md : "auto" } }
79
+ >
80
+ { selection === "mainnet"
81
+ ? t ( "page-staking-launchpad-widget-mainnet-start" )
82
+ : t ( "page-staking-launchpad-widget-testnet-start" ) }
83
+ </ ButtonLink >
84
+ </ Box >
85
+ < Text >
86
+ < Translation id = "page-staking-launchpad-widget-p3" />
87
+ </ Text >
88
+ < Box >
89
+ < ButtonLink
90
+ to = "#node-and-client-tools"
91
+ variant = "outline"
92
+ width = { { base : "full" , md : "auto" } }
93
+ >
94
+ < Emoji text = "🛠" mr = "1rem" />
95
+ < Translation id = "page-staking-launchpad-widget-link" />
96
+ </ ButtonLink >
97
+ </ Box >
98
+ </ Flex >
118
99
)
119
100
}
120
101
0 commit comments