forked from gatsbyjs/gatsby
/
_template.jsx
62 lines (59 loc) · 1.46 KB
/
_template.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import React from 'react';
import { RouteHandler, Link } from 'react-router';
import { Container, Grid, Breakpoint, Span } from 'react-responsive-grid';
import Typography from 'typography';
import { link } from 'gatsby-helpers';
var typography = new Typography();
var rhythm = typography.rhythm, fontSizeToMS = typography.fontSizeToMS;
import '../css/styles.css';
module.exports = React.createClass({
render: function() {
var header;
if (this.props.state.path === 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('/')}
>
{this.props.config.blogTitle}
</Link>
</h1>
);
} else {
header = (
<h3>
<Link
style={{
textDecoration: 'none',
color: 'inherit'
}}
to={link('/')}
>
{this.props.config.blogTitle}
</Link>
</h3>
);
}
return (
<Container
style={{
maxWidth: rhythm(24),
padding: `${rhythm(2)} ${rhythm(1/2)}`
}}
>
{header}
<RouteHandler typography={typography} {...this.props}/>
</Container>
);
}
});