Update starter to latest canary

This commit is contained in:
Kyle Mathews 2017-05-19 11:57:38 +02:00
parent 1d2329c1c9
commit 6a806c21cd
8 changed files with 1295 additions and 1624 deletions

74
src/layouts/index.js Normal file
View file

@ -0,0 +1,74 @@
import React from "react"
import Link from "gatsby-link"
import { Container } from "react-responsive-grid"
import { rhythm, scale } from "../utils/typography"
class Template extends React.Component {
render() {
const { location, children } = this.props
let header
if (location.pathname === "/") {
header = (
<h1
style={{
...scale(1.5),
marginBottom: rhythm(1.5),
marginTop: 0,
}}
>
<Link
style={{
boxShadow: "none",
textDecoration: "none",
color: "inherit",
}}
to={"/"}
>
Gatsby Starter Blog
</Link>
</h1>
)
} else {
header = (
<h3
style={{
fontFamily: "Montserrat, sans-serif",
marginTop: 0,
marginBottom: rhythm(-1),
}}
>
<Link
style={{
boxShadow: "none",
textDecoration: "none",
color: "inherit",
}}
to={"/"}
>
Gatsby Starter Blog
</Link>
</h3>
)
}
return (
<Container
style={{
maxWidth: rhythm(24),
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`,
}}
>
{header}
{children()}
</Container>
)
}
}
Template.propTypes = {
children: React.PropTypes.function,
location: React.PropTypes.object,
route: React.PropTypes.object,
}
export default Template