Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate StakingCommunityCallout component #10463

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 12 additions & 24 deletions src/components/Staking/StakingCommunityCallout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from "react"
import { useTranslation } from "gatsby-plugin-react-i18next"
import styled from "@emotion/styled"
import { graphql, useStaticQuery } from "gatsby"
import { FlexProps } from "@chakra-ui/react"
import { Flex, FlexProps } from "@chakra-ui/react"

import ButtonLink from "../ButtonLink"
import CalloutBanner from "../CalloutBanner"
Expand All @@ -11,20 +10,6 @@ import Translation from "../Translation"
import { trackCustomEvent } from "../../utils/matomo"
import { getImage } from "../../utils/image"

const ButtonContainer = styled.div`
display: flex;
gap: 1rem;
@media (max-width: ${({ theme }) => theme.breakpoints.m}) {
flex-direction: column;
}
`

const StyledButtonLink = styled(ButtonLink)`
@media (max-width: ${({ theme }) => theme.breakpoints.s}) {
width: 100%;
}
`

export interface IProps extends FlexProps {
id?: string
}
Expand Down Expand Up @@ -54,8 +39,8 @@ const StakingCommunityCallout: React.FC<IProps> = (props) => {
titleKey={"page-staking-join-community"}
descriptionKey={"page-staking-join-community-desc"}
>
<ButtonContainer>
<StyledButtonLink
<Flex gap={4} direction={{ base: "column", md: "row" }}>
<ButtonLink
onClick={() => {
trackCustomEvent({
eventCategory: `StakingCommunityCallout`,
Expand All @@ -64,10 +49,11 @@ const StakingCommunityCallout: React.FC<IProps> = (props) => {
})
}}
to="https://discord.io/ethstaker"
w={{ base: "full", md: "auto" }}
>
Discord
</StyledButtonLink>
<StyledButtonLink
</ButtonLink>
<ButtonLink
onClick={() => {
trackCustomEvent({
eventCategory: `StakingCommunityCallout`,
Expand All @@ -76,10 +62,11 @@ const StakingCommunityCallout: React.FC<IProps> = (props) => {
})
}}
to="https://reddit.com/r/ethstaker"
w={{ base: "full", md: "auto" }}
>
Reddit
</StyledButtonLink>
<StyledButtonLink
</ButtonLink>
<ButtonLink
onClick={() => {
trackCustomEvent({
eventCategory: `StakingCommunityCallout`,
Expand All @@ -88,10 +75,11 @@ const StakingCommunityCallout: React.FC<IProps> = (props) => {
})
}}
to="https://ethstaker.cc"
w={{ base: "full", md: "auto" }}
>
<Translation id="rollup-component-website" />
</StyledButtonLink>
</ButtonContainer>
</ButtonLink>
</Flex>
</CalloutBanner>
)
}
Expand Down