1
1
import React from "react"
2
2
import styled from "styled-components"
3
3
import { GatsbyImage , getImage } from "gatsby-plugin-image"
4
- import { graphql } from "gatsby"
4
+ import { graphql , PageProps } from "gatsby"
5
5
import { useIntl } from "gatsby-plugin-intl"
6
6
7
7
import ActionCard from "../components/ActionCard"
@@ -21,7 +21,7 @@ import {
21
21
Page ,
22
22
} from "../components/SharedStyledComponents"
23
23
import { translateMessageId } from "../utils/translations"
24
- import { IGatsbyChildImageSharp } from "./assets "
24
+ import { Context } from "../types "
25
25
26
26
const ButtonRow = styled . div `
27
27
display: flex;
@@ -307,25 +307,23 @@ const StyledCallout = styled(Callout)`
307
307
min-height: 100%;
308
308
`
309
309
310
- export interface IProps {
311
- data : Record < string , IGatsbyChildImageSharp >
312
- }
313
-
314
- export interface ICard {
310
+ interface ICard {
315
311
image : any // Gatsby image type
316
312
title : string
317
313
description : string
318
314
alt : string
319
315
to : string
320
316
}
321
317
322
- export interface IGetInvolvedCard {
318
+ interface IGetInvolvedCard {
323
319
emoji : string
324
320
title : string
325
321
description : string
326
322
}
327
323
328
- const CommunityPage : React . FC < IProps > = ( { data } ) => {
324
+ const CommunityPage = ( {
325
+ data,
326
+ } : PageProps < Queries . CommunityPageQuery , Context > ) => {
329
327
const intl = useIntl ( )
330
328
331
329
const heroContent = {
@@ -336,7 +334,7 @@ const CommunityPage: React.FC<IProps> = ({ data }) => {
336
334
alt : translateMessageId ( "page-community-hero-alt" , intl ) ,
337
335
}
338
336
339
- const cards : ICard [ ] = [
337
+ const cards : Array < ICard > = [
340
338
{
341
339
image : getImage ( data . docking ) ,
342
340
title : translateMessageId ( "page-community-card-1-title" , intl ) ,
@@ -379,7 +377,7 @@ const CommunityPage: React.FC<IProps> = ({ data }) => {
379
377
} ,
380
378
]
381
379
382
- const whyGetInvolvedCards : IGetInvolvedCard [ ] = [
380
+ const whyGetInvolvedCards : Array < IGetInvolvedCard > = [
383
381
{
384
382
emoji : ":mage:" ,
385
383
title : translateMessageId (
@@ -607,7 +605,7 @@ const CommunityPage: React.FC<IProps> = ({ data }) => {
607
605
export default CommunityPage
608
606
609
607
export const query = graphql `
610
- query {
608
+ query CommunityPage {
611
609
enterprise: file(relativePath: { eq: "enterprise-eth.png" }) {
612
610
childImageSharp {
613
611
gatsbyImageData(
0 commit comments