Add Flow Typing for Post/Author.js

This commit is contained in:
Victor Zhou 2019-04-10 16:21:54 -04:00
parent c11a2731a4
commit 744363e307

View File

@ -1,9 +1,10 @@
// @flow
import React from 'react'; import React from 'react';
import { graphql, StaticQuery } from 'gatsby'; import { graphql, StaticQuery } from 'gatsby';
import { getContactHref } from '../../../utils'; import { getContactHref } from '../../../utils';
import styles from './Author.module.scss'; import styles from './Author.module.scss';
export const PureAuthor = ({ data }) => { export const PureAuthor = ({ data }: Object) => {
const { author } = data.site.siteMetadata; const { author } = data.site.siteMetadata;
return ( return (
@ -23,7 +24,7 @@ export const PureAuthor = ({ data }) => {
); );
}; };
export const Author = (props) => ( export const Author = () => (
<StaticQuery <StaticQuery
query={graphql` query={graphql`
query AuthorQuery { query AuthorQuery {
@ -32,7 +33,7 @@ export const Author = (props) => (
author { author {
name name
bio bio
contacts { contacts {
twitter twitter
} }
} }
@ -40,7 +41,7 @@ export const Author = (props) => (
} }
} }
`} `}
render={(data) => <PureAuthor {...props} data={data} />} render={(data) => <PureAuthor data={data} />}
/> />
); );