@@ -2,16 +2,74 @@ 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"
5
6
import axios from "axios"
6
7
7
- import Emoji from "./Emoji "
8
+ import Emoji from "./OldEmoji "
8
9
import Translation from "./Translation"
10
+ import Icon from "./Icon"
9
11
import Link from "./Link"
10
12
import Tooltip from "./Tooltip"
11
13
12
14
import { getImage } from "../utils/image"
13
- import { Box , Flex , Heading , Icon , Text } from "@chakra-ui/react"
14
- import { MdInfoOutline } from "react-icons/md"
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
+ `
15
73
16
74
export const TokenLogo = graphql `
17
75
fragment TokenLogo on File {
@@ -85,10 +143,10 @@ const BugBountyPoints: React.FC<IProps> = () => {
85
143
: 0
86
144
87
145
const tooltipContent = (
88
- < Box >
146
+ < div >
89
147
< Translation id = "data-provided-by" /> { " " }
90
148
< Link to = "https://www.coingecko.com/en/api" > coingecko.com</ Link >
91
- </ Box >
149
+ </ div >
92
150
)
93
151
94
152
const data = useStaticQuery ( graphql `
@@ -107,100 +165,57 @@ const BugBountyPoints: React.FC<IProps> = () => {
107
165
const ethImage = isDarkTheme ? data . ethDark : data . ethLight
108
166
109
167
return (
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" >
168
+ < PointsExchange >
169
+ < PointsExchangeLabel >
121
170
< Translation id = "page-upgrades-bug-bounty-points-exchange" /> { " " }
122
171
< Tooltip content = { tooltipContent } >
123
- < Icon as = { MdInfoOutline } fill = "text200" boxSize = "4 " />
172
+ < InfoIcon name = "info" size = "14 " />
124
173
</ Tooltip >
125
- </ Box >
126
- < Heading
127
- as = "h2"
128
- mt = { 0 }
129
- fontFamily = "monospace"
130
- fontSize = "2xl"
131
- fontWeight = "bold"
132
- >
174
+ </ PointsExchangeLabel >
175
+ < PointsExchangeTitle >
133
176
< Translation id = "page-upgrades-bug-bounty-points-point" />
134
- </ Heading >
177
+ </ PointsExchangeTitle >
135
178
{ state . hasError && (
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 } >
179
+ < ValueRow >
180
+ < TokenValue >
143
181
< Translation id = "page-upgrades-bug-bounty-points-error" />
144
- </ Text >
145
- </ Flex >
182
+ </ TokenValue >
183
+ </ ValueRow >
146
184
) }
147
185
{ isLoading && ! state . hasError && (
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 } >
186
+ < ValueRow >
187
+ < TokenValue >
155
188
< Translation id = "page-upgrades-bug-bounty-points-loading" />
156
- </ Text >
157
- </ Flex >
189
+ </ TokenValue >
190
+ </ ValueRow >
158
191
) }
159
192
{ ! isLoading && ! state . hasError && (
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 } >
193
+ < ValueRow >
194
+ < Row >
195
+ < Emoji mr = { `0.5rem` } text = ":dollar:" />
196
+ < TokenValue >
170
197
< Translation id = "page-upgrades-bug-bounty-points-usd" />
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 >
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 >
194
209
) }
195
- < Text >
210
+ < p >
196
211
< Translation id = "page-upgrades-bug-bounty-points-payout-desc" />
197
- </ Text >
198
- < Text mb = { 0 } >
199
- < Text as = "em" >
212
+ </ p >
213
+ < TextNoMargin >
214
+ < em >
200
215
< Translation id = "page-upgrades-bug-bounty-points-rights-desc" />
201
- </ Text >
202
- </ Text >
203
- </ Box >
216
+ </ em >
217
+ </ TextNoMargin >
218
+ </ PointsExchange >
204
219
)
205
220
}
206
221
0 commit comments