Skip to content

Instantly share code, notes, and snippets.

@konstantinmuenster
Created May 24, 2020 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konstantinmuenster/c4039fd4392dfad1a29c110af963447c to your computer and use it in GitHub Desktop.
Save konstantinmuenster/c4039fd4392dfad1a29c110af963447c to your computer and use it in GitHub Desktop.
layout.js (1) - How To Gatsby Portfolio
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