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

TS migrate BeaconChainActions #6662

Merged
merged 3 commits into from
Jun 14, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { translateMessageId } from "../utils/translations"
import CardList from "./CardList"
import Card from "./Card"
import ButtonLink from "./ButtonLink"
import Translation from "../components/Translation"
import Translation from "./Translation"

import type { CardListItem } from "./CardList"

const Container = styled.div`
margin-bottom: 4rem;
Expand Down Expand Up @@ -69,36 +71,51 @@ export const DataLogo = graphql`
}
`

const BeaconChainActions = () => {
const intl = useIntl()
const data = useStaticQuery(graphql`
query {
beaconscan: file(relativePath: { eq: "upgrades/etherscan.png" }) {
...DataLogo
}
beaconchain: file(relativePath: { eq: "upgrades/beaconchainemoji.png" }) {
...DataLogo
}
type ChildImage = {
childImageSharp: {
gatsbyImageData: Record<string, unknown>
}
}

const BeaconStaticQuery = graphql`
query {
pettinarip marked this conversation as resolved.
Show resolved Hide resolved
beaconscan: file(relativePath: { eq: "upgrades/etherscan.png" }) {
...DataLogo
}
beaconchain: file(relativePath: { eq: "upgrades/beaconchainemoji.png" }) {
...DataLogo
}
`)
}
`

type BeaconQueryTypes = {
beaconscan: ChildImage
beaconchain: ChildImage
}

const BeaconChainActions: React.FC = () => {
const intl = useIntl()
const data = useStaticQuery<BeaconQueryTypes>(BeaconStaticQuery)

const datapoints = [
const datapoints: Array<CardListItem> = [
{
title: "beaconscan",
image: getImage(data.beaconscan),
alt: "",
link: "https://beaconscan.com",
description: translateMessageId("consensus-beaconscan-desc", intl),
},
{
title: "beaconcha.in",
image: getImage(data.beaconchain),
alt: "",
link: "https://beaconcha.in",
description: translateMessageId("consensus-beaconcha-in-desc", intl),
},
]

//TODO: we should refactor the naming here instead of using authors into the description field
const reads = [
const reads: Array<CardListItem> = [
{
title: translateMessageId(
"page-upgrade-article-title-two-point-oh",
Expand Down