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 upgrade pages to ts #7198

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/components/ActionCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import React, { ReactNode } from "react"
import styled from "styled-components"
import { GatsbyImage } from "gatsby-plugin-image"

Expand Down Expand Up @@ -69,8 +69,8 @@ export interface IProps {
to: string
alt?: string
image: string
title: string
description?: string
title: ReactNode
description?: ReactNode
className?: string
isRight?: boolean
isBottom?: boolean
Expand Down
16 changes: 9 additions & 7 deletions src/pages/upgrades/index.js → src/pages/upgrades/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import styled from "styled-components"
import { GatsbyImage, getImage } from "gatsby-plugin-image"
import { graphql } from "gatsby"
import { graphql, PageProps } from "gatsby"
import { useIntl } from "react-intl"

import ButtonLink from "../../components/ButtonLink"
Expand All @@ -16,7 +16,9 @@ import InfoBanner from "../../components/InfoBanner"
import Link from "../../components/Link"
import PageMetadata from "../../components/PageMetadata"
import Translation from "../../components/Translation"
import PageHero from "../../components/PageHero"
import PageHero, {
IContent as IPageHeroContent,
} from "../../components/PageHero"
import {
CardContainer,
Content,
Expand Down Expand Up @@ -221,10 +223,10 @@ const paths = [
},
]

const Eth2IndexPage = ({ data }) => {
const Eth2IndexPage = ({ data }: PageProps<Queries.UpgradesPageQuery>) => {
const intl = useIntl()

const heroContent = {
const heroContent: IPageHeroContent = {
title: translateMessageId("page-upgrades-upgrades", intl),
header: translateMessageId("page-upgrades-upgrading", intl),
subtitle: translateMessageId("page-upgrades-upgrade-desc", intl),
Expand All @@ -233,12 +235,12 @@ const Eth2IndexPage = ({ data }) => {
buttons: [
{
content: translateMessageId("page-upgrades-explore-btn", intl),
path: "/upgrades/beacon-chain/",
to: "/upgrades/beacon-chain/",
},
{
content: translateMessageId("page-upgrades-whats-ethereum", intl),
path: "/what-is-ethereum/",
isSecondary: "isSecondary",
to: "/what-is-ethereum/",
isSecondary: true,
},
],
}
Expand Down
15 changes: 10 additions & 5 deletions src/pages/upgrades/vision.js → src/pages/upgrades/vision.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import styled from "styled-components"
import { graphql } from "gatsby"
import { graphql, PageProps } from "gatsby"
import { useIntl } from "react-intl"
import { getImage } from "gatsby-plugin-image"

Expand All @@ -11,7 +11,9 @@ import ActionCard from "../../components/ActionCard"
import Link from "../../components/Link"
import Emoji from "../../components/Emoji"
import Trilemma from "../../components/Trilemma"
import PageHero from "../../components/PageHero"
import PageHero, {
IContent as IPageHeroContent,
} from "../../components/PageHero"
import Breadcrumbs from "../../components/Breadcrumbs"
import ButtonLink from "../../components/ButtonLink"
import PageMetadata from "../../components/PageMetadata"
Expand Down Expand Up @@ -87,10 +89,13 @@ const paths = [
},
]

const VisionPage = ({ data, location }) => {
const VisionPage = ({
data,
location,
}: PageProps<Queries.UpgradesVisionPageQuery>) => {
const intl = useIntl()

const heroContent = {
const heroContent: IPageHeroContent = {
title: translateMessageId("page-upgrades-vision-title", intl),
header: translateMessageId("page-upgrades-vision-future", intl),
subtitle: translateMessageId("page-upgrades-vision-subtitle", intl),
Expand Down Expand Up @@ -297,7 +302,7 @@ const VisionPage = ({ data, location }) => {
{upgrades.map((upgrade, idx) => (
<ActionCard
isRight
key={upgrade.title}
key={idx}
image={upgrade.image}
title={upgrade.title}
description={upgrade.description}
Expand Down