Fix issue with last PR that modified layout.js instead of Layout.js

This commit is contained in:
Joaquin Bravo Contreras 2018-11-08 17:26:56 -06:00
parent 7f89fb3084
commit c96263c9da
2 changed files with 3 additions and 74 deletions

View file

@ -5,7 +5,7 @@ import { rhythm, scale } from '../utils/typography'
class Layout extends React.Component {
render() {
const { location, children } = this.props
const { location, title, children } = this.props
const rootPath = `${__PATH_PREFIX__}/`
let header
@ -26,7 +26,7 @@ class Layout extends React.Component {
}}
to={'/'}
>
Gatsby Starter Blog
{title}
</Link>
</h1>
)
@ -47,7 +47,7 @@ class Layout extends React.Component {
}}
to={'/'}
>
Gatsby Starter Blog
{title}
</Link>
</h3>
)

View file

@ -1,71 +0,0 @@
import React from 'react'
import { Link } from 'gatsby'
import { rhythm, scale } from '../utils/typography'
class Layout extends React.Component {
render() {
const { location, title, children } = this.props
const rootPath = `${__PATH_PREFIX__}/`
let header
if (location.pathname === rootPath) {
header = (
<h1
style={{
...scale(1.5),
marginBottom: rhythm(1.5),
marginTop: 0,
}}
>
<Link
style={{
boxShadow: 'none',
textDecoration: 'none',
color: 'inherit',
}}
to={'/'}
>
{title}
</Link>
</h1>
)
} else {
header = (
<h3
style={{
fontFamily: 'Montserrat, sans-serif',
marginTop: 0,
marginBottom: rhythm(-1),
}}
>
<Link
style={{
boxShadow: 'none',
textDecoration: 'none',
color: 'inherit',
}}
to={'/'}
>
{title}
</Link>
</h3>
)
}
return (
<div
style={{
marginLeft: 'auto',
marginRight: 'auto',
maxWidth: rhythm(24),
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`,
}}
>
{header}
{children}
</div>
)
}
}
export default Layout