Created
May 24, 2020 17:12
-
-
Save konstantinmuenster/c4039fd4392dfad1a29c110af963447c to your computer and use it in GitHub Desktop.
layout.js (1) - How To Gatsby Portfolio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import styled from "styled-components" | |
import GlobalStyle from "./globalStyle" | |
import Header from "./header" | |
import Footer from "./footer" | |
const StyledLayout = styled.div` | |
width: 100%; | |
min-height: 100vh; | |
margin: 0 auto; | |
display: grid; | |
grid-template-rows: auto 1fr auto; | |
grid-template-columns: 100%; | |
#main-content { | |
width: 100%; | |
max-width: 62.5rem; | |
margin: 0 auto; | |
padding: 0 2.5rem; | |
} | |
` | |
const Layout = ({ children }) => { | |
return ( | |
<StyledLayout> | |
<GlobalStyle /> | |
<Header /> | |
<main id="main-content">{children}</main> | |
<Footer /> | |
</StyledLayout> | |
) | |
} | |
export default Layout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment