text: import React from 'react'
  import PropTypes from 'prop-types'
  import { StaticQuery, graphql } from 'gatsby'
  import styled from 'styled-components'
  import Header from './header'
  import Archive from './archive'
  import './layout.css'
  import Img from 'gatsby-image'
  
  const MainLayout = styled.main`
    max-width: 90%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-gap: 40px;
  `
  
  const Layout = ({ children, location }) => (
    <StaticQuery
      query={graphql`
        query SiteTitleQuery {
          site {
            siteMetadata {
              title
              description
            }
          }
          file(relativePath: { regex: "/molecular/" }) {
            childImageSharp {
              fluid(maxWidth: 1000) {
                ...GatsbyImageSharpFluid
              }
            }
          }
        }
      `}
      render={data => (
        <>
          <Header siteTitle={data.site.siteMetadata.title} />
          {location.pathname === '/' && (
            <Img
              style={{
                width: '300px',
              }}
              fluid={data.file.childImageSharp.fluid}
            />
          )}
  
          <MainLayout>
            <div>{children}</div>
            <Archive />
          </MainLayout>
        </>
      )}
    />
  )
  
  Layout.propTypes = {
    children: PropTypes.node.isRequired,
  }
  
  Layout.defaultProps = {
    location: {},
  }
  
  export default Layout
  