forked from davidsonfellipe/awesome-wpo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLayout.js
57 lines (45 loc) · 981 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
51
52
53
54
55
56
57
/**
* 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 "./layout.css"
import styled from "styled-components"
import { screen } from "../styles/screen"
import { font } from "../styles/theme"
import Header from "./Header"
import Footer from "./Footer"
const Wrapper = styled.div`
font-family: ${font.text};
padding: 15px 7px 15px 0;
margin: 0 auto;
width: 100%;
overflow: hidden;
max-width: ${screen.max};
a {
color: inherit;
}
`
const Section = styled.div`
display: inline-block;
padding: 15px;
vertical-align: top;
width: 100%;
${screen.lg} {
padding: 0;
}
`
const Layout = ({ children }) => (
<Wrapper>
<Header />
<Section>{children}</Section>
<Footer />
</Wrapper>
)
Layout.propTypes = {
children: PropTypes.node.isRequired,
}
export default Layout