text: /**
   * Layout component that queries for data
   * with Gatsby's useStaticQuery component
   *
   * See: https://www.gatsbyjs.org/docs/use-static-query/
   */
  
  import React from "react"
  import PropTypes from "prop-types"
  import { useStaticQuery, graphql } from "gatsby"
  import styled from "styled-components"
  import Header from "./header"
  import { PageContainer } from "./sharedStyles"
  import "./layout.css"
  
  const Footer = styled.footer`
    font-family: "Poppins";
    margin-top: 20px;
    font-size: 14px;
  `
  
  const Main = styled.main`
    width: 100%;
    min-height: 80vh;
    max-width: 1200px;
  `
  
  const Layout = ({ children, smallHeader, dark }) => {
    const data = useStaticQuery(graphql`
      query SiteTitleQuery {
        site {
          siteMetadata {
            title
          }
        }
      }
    `)
  
    return (
      <>
        <Header
          siteTitle={data.site.siteMetadata.title}
          smallHeader={smallHeader}
          dark={dark}
        />
        <PageContainer>
          <Main>{children}</Main>
          <Footer>© {new Date().getFullYear()} | Ian Lenehan</Footer>
        </PageContainer>
      </>
    )
  }
  
  Layout.propTypes = {
    children: PropTypes.node.isRequired,
  }
  
  export default Layout
  