-
Notifications
You must be signed in to change notification settings - Fork 3
/
layout.js
50 lines (42 loc) · 944 Bytes
/
layout.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* Layout component that queries for data
* with Gatsby's StaticQuery component
*
* See: https://www.gatsbyjs.org/docs/static-query/
*/
import React from "react"
import PropTypes from "prop-types"
import { StaticQuery, graphql } from "gatsby"
import styled from 'styled-components';
import Header from "./Header/header"
import Footer from '../components/footer'
const LayoutDiv = styled.div`
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
`;
const Layout = ({ children }) => (
<StaticQuery
query={graphql`
query SiteTitleQuery {
site {
siteMetadata {
title
}
}
}
`}
render={data => (
<LayoutDiv>
<Header/>
{ children }
<Footer />
</LayoutDiv>
)}
/>
)
Layout.propTypes = {
children: PropTypes.node.isRequired,
}
export default Layout