@@ -2,74 +2,16 @@ import React, { useState, useEffect } from "react"
2
2
import { useTheme } from "@emotion/react"
3
3
import { useStaticQuery , graphql } from "gatsby"
4
4
import { GatsbyImage } from "gatsby-plugin-image"
5
- import styled from "@emotion/styled"
6
5
import axios from "axios"
7
6
8
- import Emoji from "./OldEmoji "
7
+ import Emoji from "./Emoji "
9
8
import Translation from "./Translation"
10
- import Icon from "./Icon"
11
9
import Link from "./Link"
12
10
import Tooltip from "./Tooltip"
13
11
14
12
import { getImage } from "../utils/image"
15
-
16
- const PointsExchange = styled . div `
17
- flex: 1 1 560px;
18
- padding: 1.5rem;
19
- border: 1px solid ${ ( props ) => props . theme . colors . border } ;
20
- border-radius: 2px;
21
- margin: 0 2rem;
22
- @media (max-width: ${ ( props ) => props . theme . breakpoints . l } ) {
23
- margin: 2rem 0;
24
- }
25
- `
26
-
27
- const PointsExchangeLabel = styled . div `
28
- text-transform: uppercase;
29
- font-size: 0.875rem;
30
- margin-bottom: 1rem;
31
- `
32
-
33
- const PointsExchangeTitle = styled . h2 `
34
- font-family: ${ ( props ) => props . theme . fonts . monospace } ;
35
- font-size: 1.5rem;
36
- font-weight: 700;
37
- text-transform: uppercase;
38
- margin-top: 0rem;
39
- `
40
-
41
- const InfoIcon = styled ( Icon ) `
42
- margin-left: 0.5rem;
43
- fill: ${ ( props ) => props . theme . colors . text200 } ;
44
- `
45
-
46
- const TextNoMargin = styled . p `
47
- margin-bottom: 0rem;
48
- `
49
-
50
- const Token = styled ( GatsbyImage ) `
51
- margin-right: 0.5rem;
52
- `
53
-
54
- const TokenValue = styled . p `
55
- font-size: 1.25rem;
56
- margin: 0rem;
57
- margin-right: 1rem;
58
- `
59
-
60
- const Row = styled . div `
61
- display: flex;
62
- align-items: center;
63
- flex-wrap: wrap;
64
- `
65
-
66
- const ValueRow = styled ( Row ) `
67
- margin-bottom: 2rem;
68
- @media (max-width: ${ ( props ) => props . theme . breakpoints . s } ) {
69
- flex-direction: column;
70
- align-items: flex-start;
71
- }
72
- `
13
+ import { Box , Flex , Heading , Icon , Text } from "@chakra-ui/react"
14
+ import { MdInfoOutline } from "react-icons/md"
73
15
74
16
export const TokenLogo = graphql `
75
17
fragment TokenLogo on File {
@@ -143,10 +85,10 @@ const BugBountyPoints: React.FC<IProps> = () => {
143
85
: 0
144
86
145
87
const tooltipContent = (
146
- < div >
88
+ < Box >
147
89
< Translation id = "data-provided-by" /> { " " }
148
90
< Link to = "https://www.coingecko.com/en/api" > coingecko.com</ Link >
149
- </ div >
91
+ </ Box >
150
92
)
151
93
152
94
const data = useStaticQuery ( graphql `
@@ -165,57 +107,100 @@ const BugBountyPoints: React.FC<IProps> = () => {
165
107
const ethImage = isDarkTheme ? data . ethDark : data . ethLight
166
108
167
109
return (
168
- < PointsExchange >
169
- < PointsExchangeLabel >
110
+ < Box
111
+ flex = "1 1 560px"
112
+ mx = { { base : 0 , lg : 8 } }
113
+ my = { { base : 8 , lg : 0 } }
114
+ p = { 6 }
115
+ border = "1px solid"
116
+ borderColor = "border"
117
+ borderRadius = "2px"
118
+ textTransform = "uppercase"
119
+ >
120
+ < Box mb = { 4 } fontSize = "sm" >
170
121
< Translation id = "page-upgrades-bug-bounty-points-exchange" /> { " " }
171
122
< Tooltip content = { tooltipContent } >
172
- < InfoIcon name = "info" size = "14 " />
123
+ < Icon as = { MdInfoOutline } fill = "text200" boxSize = "4 " />
173
124
</ Tooltip >
174
- </ PointsExchangeLabel >
175
- < PointsExchangeTitle >
125
+ </ Box >
126
+ < Heading
127
+ as = "h2"
128
+ mt = { 0 }
129
+ fontFamily = "monospace"
130
+ fontSize = "2xl"
131
+ fontWeight = "bold"
132
+ >
176
133
< Translation id = "page-upgrades-bug-bounty-points-point" />
177
- </ PointsExchangeTitle >
134
+ </ Heading >
178
135
{ state . hasError && (
179
- < ValueRow >
180
- < TokenValue >
136
+ < Flex
137
+ align = { { base : "start" , sm : "center" } }
138
+ direction = { { base : "column" , sm : "row" } }
139
+ wrap = "wrap"
140
+ mb = { 8 }
141
+ >
142
+ < Text fontSize = "xl" m = { 0 } mr = { 4 } >
181
143
< Translation id = "page-upgrades-bug-bounty-points-error" />
182
- </ TokenValue >
183
- </ ValueRow >
144
+ </ Text >
145
+ </ Flex >
184
146
) }
185
147
{ isLoading && ! state . hasError && (
186
- < ValueRow >
187
- < TokenValue >
148
+ < Flex
149
+ align = { { base : "start" , sm : "center" } }
150
+ direction = { { base : "column" , sm : "row" } }
151
+ wrap = "wrap"
152
+ mb = { 8 }
153
+ >
154
+ < Text fontSize = "xl" m = { 0 } mr = { 4 } >
188
155
< Translation id = "page-upgrades-bug-bounty-points-loading" />
189
- </ TokenValue >
190
- </ ValueRow >
156
+ </ Text >
157
+ </ Flex >
191
158
) }
192
159
{ ! isLoading && ! state . hasError && (
193
- < ValueRow >
194
- < Row >
195
- < Emoji mr = { `0.5rem` } text = ":dollar:" />
196
- < TokenValue >
160
+ < Flex
161
+ align = { { base : "start" , sm : "center" } }
162
+ direction = { { base : "column" , sm : "row" } }
163
+ wrap = "wrap"
164
+ mb = { 8 }
165
+ gap = { 2 }
166
+ >
167
+ < Flex align = "center" wrap = "wrap" >
168
+ < Emoji fontSize = "xl" mr = { 2 } text = ":dollar:" />
169
+ < Text fontSize = "xl" m = { 0 } mr = { 4 } >
197
170
< Translation id = "page-upgrades-bug-bounty-points-usd" />
198
- </ TokenValue >
199
- </ Row >
200
- < Row >
201
- < Token image = { getImage ( data . dai ) ! } alt = "" />
202
- < TokenValue > { pointsInDAI } DAI</ TokenValue >
203
- </ Row >
204
- < Row >
205
- < Token image = { getImage ( ethImage ) ! } alt = "" />
206
- < TokenValue > { pointsInETH } ETH</ TokenValue >
207
- </ Row >
208
- </ ValueRow >
171
+ </ Text >
172
+ </ Flex >
173
+ < Flex align = "center" wrap = "wrap" >
174
+ < GatsbyImage
175
+ image = { getImage ( data . dai ) ! }
176
+ style = { { marginRight : "0.5rem" } }
177
+ alt = ""
178
+ />
179
+ < Text fontSize = "xl" m = { 0 } mr = { 4 } >
180
+ { pointsInDAI } DAI
181
+ </ Text >
182
+ </ Flex >
183
+ < Flex align = "center" wrap = "wrap" >
184
+ < GatsbyImage
185
+ image = { getImage ( ethImage ) ! }
186
+ style = { { marginRight : "0.5rem" } }
187
+ alt = ""
188
+ />
189
+ < Text fontSize = "xl" m = { 0 } mr = { 4 } >
190
+ { pointsInETH } ETH
191
+ </ Text >
192
+ </ Flex >
193
+ </ Flex >
209
194
) }
210
- < p >
195
+ < Text >
211
196
< Translation id = "page-upgrades-bug-bounty-points-payout-desc" />
212
- </ p >
213
- < TextNoMargin >
214
- < em >
197
+ </ Text >
198
+ < Text mb = { 0 } >
199
+ < Text as = "em" >
215
200
< Translation id = "page-upgrades-bug-bounty-points-rights-desc" />
216
- </ em >
217
- </ TextNoMargin >
218
- </ PointsExchange >
201
+ </ Text >
202
+ </ Text >
203
+ </ Box >
219
204
)
220
205
}
221
206
0 commit comments