Moving query for siteMetadata to Layout

This commit is contained in:
Jeff Avallone
2019-01-08 07:09:06 -05:00
parent f14e018518
commit 1e4e5d82d1
5 changed files with 59 additions and 47 deletions
+1 -16
View File
@@ -1,20 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import { StaticQuery, graphql } from 'gatsby';
import { withNamespaces, Trans } from 'react-i18next';
import style from './style.module.css';
const query = graphql`
query FooterQuery {
site {
siteMetadata {
buildId
}
}
}
`;
export const Footer = ({ t, buildId }) => (
<footer className={ style.footer }>
<ul className={ style.list }>
@@ -43,8 +32,4 @@ Footer.propTypes = {
buildId: PropTypes.string.isRequired
};
export default withNamespaces()(props => (
<StaticQuery query={ query } render={ ({ site: { siteMetadata } }) => (
<Footer { ...props } { ...siteMetadata } />
) } />
));
export default withNamespaces()(Footer);