Skip to content

Commit 866cae8

Browse files
authored
Merge pull request #10463 from ethereum/migrate-staking-comm-callout
Migrate `StakingCommunityCallout` component
2 parents 27a45c7 + 947fd5a commit 866cae8

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

src/components/Staking/StakingCommunityCallout.tsx

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from "react"
22
import { useTranslation } from "gatsby-plugin-react-i18next"
3-
import styled from "@emotion/styled"
43
import { graphql, useStaticQuery } from "gatsby"
5-
import { FlexProps } from "@chakra-ui/react"
4+
import { Flex, FlexProps } from "@chakra-ui/react"
65

76
import ButtonLink from "../ButtonLink"
87
import CalloutBanner from "../CalloutBanner"
@@ -11,20 +10,6 @@ import Translation from "../Translation"
1110
import { trackCustomEvent } from "../../utils/matomo"
1211
import { getImage } from "../../utils/image"
1312

14-
const ButtonContainer = styled.div`
15-
display: flex;
16-
gap: 1rem;
17-
@media (max-width: ${({ theme }) => theme.breakpoints.m}) {
18-
flex-direction: column;
19-
}
20-
`
21-
22-
const StyledButtonLink = styled(ButtonLink)`
23-
@media (max-width: ${({ theme }) => theme.breakpoints.s}) {
24-
width: 100%;
25-
}
26-
`
27-
2813
export interface IProps extends FlexProps {
2914
id?: string
3015
}
@@ -54,8 +39,8 @@ const StakingCommunityCallout: React.FC<IProps> = (props) => {
5439
titleKey={"page-staking-join-community"}
5540
descriptionKey={"page-staking-join-community-desc"}
5641
>
57-
<ButtonContainer>
58-
<StyledButtonLink
42+
<Flex gap={4} direction={{ base: "column", md: "row" }}>
43+
<ButtonLink
5944
onClick={() => {
6045
trackCustomEvent({
6146
eventCategory: `StakingCommunityCallout`,
@@ -64,10 +49,11 @@ const StakingCommunityCallout: React.FC<IProps> = (props) => {
6449
})
6550
}}
6651
to="https://discord.io/ethstaker"
52+
w={{ base: "full", md: "auto" }}
6753
>
6854
Discord
69-
</StyledButtonLink>
70-
<StyledButtonLink
55+
</ButtonLink>
56+
<ButtonLink
7157
onClick={() => {
7258
trackCustomEvent({
7359
eventCategory: `StakingCommunityCallout`,
@@ -76,10 +62,11 @@ const StakingCommunityCallout: React.FC<IProps> = (props) => {
7662
})
7763
}}
7864
to="https://reddit.com/r/ethstaker"
65+
w={{ base: "full", md: "auto" }}
7966
>
8067
Reddit
81-
</StyledButtonLink>
82-
<StyledButtonLink
68+
</ButtonLink>
69+
<ButtonLink
8370
onClick={() => {
8471
trackCustomEvent({
8572
eventCategory: `StakingCommunityCallout`,
@@ -88,10 +75,11 @@ const StakingCommunityCallout: React.FC<IProps> = (props) => {
8875
})
8976
}}
9077
to="https://ethstaker.cc"
78+
w={{ base: "full", md: "auto" }}
9179
>
9280
<Translation id="rollup-component-website" />
93-
</StyledButtonLink>
94-
</ButtonContainer>
81+
</ButtonLink>
82+
</Flex>
9583
</CalloutBanner>
9684
)
9785
}

0 commit comments

Comments
 (0)