Skip to content

Commit b3809c8

Browse files
committed
Revert "refactor: roadmap to chakra"
This reverts commit d2332b4.
1 parent d2332b4 commit b3809c8

File tree

1 file changed

+99
-84
lines changed

1 file changed

+99
-84
lines changed

src/components/BugBountyPoints.tsx

Lines changed: 99 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,74 @@ import React, { useState, useEffect } from "react"
22
import { useTheme } from "@emotion/react"
33
import { useStaticQuery, graphql } from "gatsby"
44
import { GatsbyImage } from "gatsby-plugin-image"
5+
import styled from "@emotion/styled"
56
import axios from "axios"
67

7-
import Emoji from "./Emoji"
8+
import Emoji from "./OldEmoji"
89
import Translation from "./Translation"
10+
import Icon from "./Icon"
911
import Link from "./Link"
1012
import Tooltip from "./Tooltip"
1113

1214
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+
`
1573

1674
export const TokenLogo = graphql`
1775
fragment TokenLogo on File {
@@ -85,10 +143,10 @@ const BugBountyPoints: React.FC<IProps> = () => {
85143
: 0
86144

87145
const tooltipContent = (
88-
<Box>
146+
<div>
89147
<Translation id="data-provided-by" />{" "}
90148
<Link to="https://www.coingecko.com/en/api">coingecko.com</Link>
91-
</Box>
149+
</div>
92150
)
93151

94152
const data = useStaticQuery(graphql`
@@ -107,100 +165,57 @@ const BugBountyPoints: React.FC<IProps> = () => {
107165
const ethImage = isDarkTheme ? data.ethDark : data.ethLight
108166

109167
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>
121170
<Translation id="page-upgrades-bug-bounty-points-exchange" />{" "}
122171
<Tooltip content={tooltipContent}>
123-
<Icon as={MdInfoOutline} fill="text200" boxSize="4" />
172+
<InfoIcon name="info" size="14" />
124173
</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>
133176
<Translation id="page-upgrades-bug-bounty-points-point" />
134-
</Heading>
177+
</PointsExchangeTitle>
135178
{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>
143181
<Translation id="page-upgrades-bug-bounty-points-error" />
144-
</Text>
145-
</Flex>
182+
</TokenValue>
183+
</ValueRow>
146184
)}
147185
{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>
155188
<Translation id="page-upgrades-bug-bounty-points-loading" />
156-
</Text>
157-
</Flex>
189+
</TokenValue>
190+
</ValueRow>
158191
)}
159192
{!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>
170197
<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>
194209
)}
195-
<Text>
210+
<p>
196211
<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>
200215
<Translation id="page-upgrades-bug-bounty-points-rights-desc" />
201-
</Text>
202-
</Text>
203-
</Box>
216+
</em>
217+
</TextNoMargin>
218+
</PointsExchange>
204219
)
205220
}
206221

0 commit comments

Comments
 (0)