Skip to content

Commit ab44844

Browse files
committed
Fix(community): Fixed props definition, array type declaration and removed unnecessary export statements
1 parent 556ece2 commit ab44844

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/pages/community.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react"
22
import styled from "styled-components"
33
import { GatsbyImage, getImage } from "gatsby-plugin-image"
4-
import { graphql } from "gatsby"
4+
import { graphql, PageProps } from "gatsby"
55
import { useIntl } from "gatsby-plugin-intl"
66

77
import ActionCard from "../components/ActionCard"
@@ -21,7 +21,7 @@ import {
2121
Page,
2222
} from "../components/SharedStyledComponents"
2323
import { translateMessageId } from "../utils/translations"
24-
import { IGatsbyChildImageSharp } from "./assets"
24+
import { Context } from "../types"
2525

2626
const ButtonRow = styled.div`
2727
display: flex;
@@ -307,25 +307,23 @@ const StyledCallout = styled(Callout)`
307307
min-height: 100%;
308308
`
309309

310-
export interface IProps {
311-
data: Record<string, IGatsbyChildImageSharp>
312-
}
313-
314-
export interface ICard {
310+
interface ICard {
315311
image: any // Gatsby image type
316312
title: string
317313
description: string
318314
alt: string
319315
to: string
320316
}
321317

322-
export interface IGetInvolvedCard {
318+
interface IGetInvolvedCard {
323319
emoji: string
324320
title: string
325321
description: string
326322
}
327323

328-
const CommunityPage: React.FC<IProps> = ({ data }) => {
324+
const CommunityPage = ({
325+
data,
326+
}: PageProps<Queries.CommunityPageQuery, Context>) => {
329327
const intl = useIntl()
330328

331329
const heroContent = {
@@ -336,7 +334,7 @@ const CommunityPage: React.FC<IProps> = ({ data }) => {
336334
alt: translateMessageId("page-community-hero-alt", intl),
337335
}
338336

339-
const cards: ICard[] = [
337+
const cards: Array<ICard> = [
340338
{
341339
image: getImage(data.docking),
342340
title: translateMessageId("page-community-card-1-title", intl),
@@ -379,7 +377,7 @@ const CommunityPage: React.FC<IProps> = ({ data }) => {
379377
},
380378
]
381379

382-
const whyGetInvolvedCards: IGetInvolvedCard[] = [
380+
const whyGetInvolvedCards: Array<IGetInvolvedCard> = [
383381
{
384382
emoji: ":mage:",
385383
title: translateMessageId(
@@ -607,7 +605,7 @@ const CommunityPage: React.FC<IProps> = ({ data }) => {
607605
export default CommunityPage
608606

609607
export const query = graphql`
610-
query {
608+
query CommunityPage {
611609
enterprise: file(relativePath: { eq: "enterprise-eth.png" }) {
612610
childImageSharp {
613611
gatsbyImageData(

0 commit comments

Comments
 (0)