Update dependencies, use .js file extensions
This commit is contained in:
parent
4d3c5ca244
commit
65431b45bb
7 changed files with 28 additions and 21 deletions
69
pages/_template.js
Normal file
69
pages/_template.js
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
import React from 'react'
|
||||
import { Link } from 'react-router'
|
||||
import { Container } from 'react-responsive-grid'
|
||||
import { link } from 'gatsby-helpers'
|
||||
import { rhythm, fontSizeToMS } from 'utils/typography'
|
||||
import { config } from 'config'
|
||||
|
||||
import '../css/styles.css'
|
||||
|
||||
class Template extends React.Component {
|
||||
render () {
|
||||
const { location, children } = this.props
|
||||
let header
|
||||
if (location.pathname === link('/')) {
|
||||
header = (
|
||||
<h1
|
||||
style={{
|
||||
fontSize: fontSizeToMS(2.5).fontSize,
|
||||
lineHeight: fontSizeToMS(2.5).lineHeight,
|
||||
marginBottom: rhythm(1.5),
|
||||
}}
|
||||
>
|
||||
<Link
|
||||
style={{
|
||||
textDecoration: 'none',
|
||||
color: 'inherit',
|
||||
}}
|
||||
to={link('/')}
|
||||
>
|
||||
{config.blogTitle}
|
||||
</Link>
|
||||
</h1>
|
||||
)
|
||||
} else {
|
||||
header = (
|
||||
<h3>
|
||||
<Link
|
||||
style={{
|
||||
textDecoration: 'none',
|
||||
color: 'inherit',
|
||||
}}
|
||||
to={link('/')}
|
||||
>
|
||||
{config.blogTitle}
|
||||
</Link>
|
||||
</h3>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<Container
|
||||
style={{
|
||||
maxWidth: rhythm(24),
|
||||
padding: `${rhythm(2)} ${rhythm(1/2)}`,
|
||||
}}
|
||||
>
|
||||
{header}
|
||||
{children}
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Template.propTypes = {
|
||||
children: React.PropTypes.any,
|
||||
location: React.PropTypes.object,
|
||||
route: React.PropTypes.object,
|
||||
}
|
||||
|
||||
export default Template
|
||||
Loading…
Add table
Add a link
Reference in a new issue