-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathLayout.tsx
More file actions
39 lines (33 loc) · 865 Bytes
/
Layout.tsx
File metadata and controls
39 lines (33 loc) · 865 Bytes
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
/**
* Layout component that queries for data
* with Gatsby's useStaticQuery component
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import { Footer, GlobalStyles, Header } from "../index"
import { graphql, useStaticQuery } from "gatsby"
import PropTypes from "prop-types"
import React from "react"
import { LayoutContainer, LayoutContainerMain } from "./Layout.styles"
export const Layout = ({ children }) => {
const data = useStaticQuery(graphql`
query SiteTitleQuery {
site {
siteMetadata {
title
}
}
}
`)
return (
<LayoutContainer>
<GlobalStyles />
<Header siteTitle={data.site.siteMetadata.title} />
<LayoutContainerMain>{children}</LayoutContainerMain>
<Footer />
</LayoutContainer>
)
}
Layout.propTypes = {
children: PropTypes.node.isRequired,
}