Skip to content

Commit

Permalink
Merge pull request gatsbyjs#1 from gesposito/master
Browse files Browse the repository at this point in the history
Converted to ES6, JSX
  • Loading branch information
KyleAMathews committed Sep 13, 2015
2 parents 6feb491 + 896b2f5 commit 86b56da
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 61 deletions.
9 changes: 0 additions & 9 deletions app.coffee

This file was deleted.

11 changes: 11 additions & 0 deletions app.js
@@ -0,0 +1,11 @@
exports.loadContext = function(callback) {
var context;
context = require.context('./pages', true);
if (module.hot) {
module.hot.accept(context.id, function() {
context = require.context('./pages', true);
return callback(context);
});
}
return callback(context);
};
29 changes: 0 additions & 29 deletions html.cjsx

This file was deleted.

38 changes: 38 additions & 0 deletions html.jsx
@@ -0,0 +1,38 @@
import React from 'react';
import Typography from 'typography';
import DocumentTitle from 'react-document-title';

var TypographyStyle = new Typography().TypographyStyle;

module.exports = React.createClass({
getDefaultProps: function() {
return {
body: ""
};
},

render: function() {
var title;
title = DocumentTitle.rewind();
if (this.props.title) {
title = this.props.title;
}

return (
<html lang="en">
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
<meta name='viewport' content='width=device-width, initial-scale=1.0 maximum-scale=1.0'/>
<title>{title}</title>
<link rel="shortcut icon" href={this.props.favicon}/>
<TypographyStyle/>
</head>
<body>
<div id="react-mount" dangerouslySetInnerHTML={{__html: this.props.body}} />
<script src="/bundle.js"/>
</body>
</html>
);
}
});
23 changes: 0 additions & 23 deletions pages/_template.cjsx

This file was deleted.

27 changes: 27 additions & 0 deletions pages/_template.jsx
@@ -0,0 +1,27 @@
import React from 'react';
import { RouteHandler, Link, State } from 'react-router';
import { Container, Grid, Breakpoint, Span } from 'react-responsive-grid';
import Typography from 'typography';

var typography = new Typography();
var rhythm = typography.rhythm, fontSizeToMS = typography.fontSizeToMS;

module.exports = React.createClass({
mixins: [State],

render: function() {
return (
<div>
<Container
style={{
maxWidth: 960,
padding: `${rhythm(1)} ${rhythm(1/2)}`,
paddingTop: 0
}}
>
<RouteHandler typography={typography} {...this.props}/>
</Container>
</div>
);
}
});

0 comments on commit 86b56da

Please sign in to comment.