Skip to content

Commit 8910d91

Browse files
author
soheil
committed
Migrate BeaconChainActions to Chakra
1 parent cd0c957 commit 8910d91

File tree

1 file changed

+32
-55
lines changed

1 file changed

+32
-55
lines changed

src/components/BeaconChainActions.tsx

Lines changed: 32 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react"
2+
import { Box, Flex, Heading } from "@chakra-ui/react"
3+
24
import { useStaticQuery, graphql } from "gatsby"
3-
import styled from "@emotion/styled"
45
import { useIntl } from "react-intl"
56

67
import { translateMessageId } from "../utils/translations"
@@ -13,50 +14,17 @@ import Translation from "./Translation"
1314

1415
import type { CardListItem } from "./CardList"
1516

16-
const Container = styled.div`
17-
margin-bottom: 4rem;
18-
`
19-
20-
const StyledCardContainer = styled.div`
21-
display: flex;
22-
padding-top: 1rem;
23-
@media (max-width: ${(props) => props.theme.breakpoints.m}) {
24-
flex-direction: column;
25-
}
26-
`
27-
28-
const StyledCardLeft = styled(Card)`
29-
margin-left: 0rem;
30-
margin-right: 1rem;
31-
width: 100%;
32-
@media (max-width: ${(props) => props.theme.breakpoints.m}) {
33-
margin-right: 0rem;
34-
margin-bottom: 2rem;
35-
}
36-
`
37-
38-
const StyledCardRight = styled(Card)`
39-
margin-left: 0rem;
40-
margin-left: 1rem;
41-
width: 100%;
42-
@media (max-width: ${(props) => props.theme.breakpoints.m}) {
43-
margin-left: 0rem;
44-
}
45-
`
46-
47-
const H3 = styled.h3`
48-
font-size: 1.5rem;
49-
font-weight: 700;
50-
margin-bottom: 2rem;
51-
52-
a {
53-
display: none;
54-
}
55-
`
56-
57-
const StyledButtonLink = styled(ButtonLink)`
58-
margin-bottom: 0.75rem;
59-
`
17+
const H3: React.FC<{ children: React.ReactNode }> = ({ children }) => (
18+
<Heading
19+
as="h3"
20+
fontSize="2xl"
21+
fontWeight="bold"
22+
mb={8}
23+
sx={{ a: { display: "none" } }}
24+
>
25+
{children}
26+
</Heading>
27+
)
6028

6129
export const DataLogo = graphql`
6230
fragment DataLogo on File {
@@ -140,21 +108,30 @@ const BeaconChainActions: React.FC = () => {
140108
]
141109

142110
return (
143-
<Container>
144-
<StyledCardContainer>
145-
<StyledCardLeft
111+
<Box mb={16}>
112+
<Flex flexDir={{ base: "column", md: "row" }} pt={4}>
113+
<Box
114+
as={Card}
115+
w="full"
116+
ml={0}
117+
mr={{ base: 0, md: 4 }}
118+
mb={{ base: 8, md: 0 }}
146119
emoji=":money_with_wings:"
147120
title={translateMessageId("consensus-become-staker", intl)}
148121
description={translateMessageId("consensus-become-staker-desc", intl)}
149122
>
150-
<StyledButtonLink to="https://launchpad.ethereum.org">
123+
<ButtonLink mb={3} to="https://launchpad.ethereum.org">
151124
<Translation id="get-started" />
152-
</StyledButtonLink>
125+
</ButtonLink>
153126
<ButtonLink variant="outline" to="/staking/">
154127
<Translation id="page-upgrades-index-staking-learn" />
155128
</ButtonLink>
156-
</StyledCardLeft>
157-
<StyledCardRight
129+
</Box>
130+
<Box
131+
as={Card}
132+
w="full"
133+
mr={0}
134+
ml={{ base: 0, md: 4 }}
158135
emoji=":computer:"
159136
title={translateMessageId("consensus-run-beacon-chain", intl)}
160137
description={translateMessageId(
@@ -165,8 +142,8 @@ const BeaconChainActions: React.FC = () => {
165142
<ButtonLink variant="outline" to="/upgrades/get-involved/">
166143
<Translation id="consensus-run-beacon-chain" />
167144
</ButtonLink>
168-
</StyledCardRight>
169-
</StyledCardContainer>
145+
</Box>
146+
</Flex>
170147
<H3>
171148
<Translation id="consensus-explore" />
172149
</H3>
@@ -176,7 +153,7 @@ const BeaconChainActions: React.FC = () => {
176153
<Translation id="read-more" />
177154
</H3>
178155
<CardList content={reads} />
179-
</Container>
156+
</Box>
180157
)
181158
}
182159

0 commit comments

Comments
 (0)