Skip to content

Commit

Permalink
Merge pull request gatsbyjs#2 from luandro/master
Browse files Browse the repository at this point in the history
Updated to es6
  • Loading branch information
KyleAMathews committed Oct 7, 2015
2 parents 7706b42 + 63473a7 commit 950e386
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 35 deletions.
13 changes: 8 additions & 5 deletions components/ReadNext.jsx
Expand Up @@ -3,10 +3,13 @@ import { Link } from 'react-router';
import { prune, include as includes } from 'underscore.string';
import find from 'lodash/collection/find';

module.exports = React.createClass({
render: function() {
var body, fontSizeToMS, html, nextPost, readNext, ref, rhythm;
ref = this.props.typography, rhythm = ref.rhythm, fontSizeToMS = ref.fontSizeToMS;
export default class extends React.Component {
render() {
let body, fontSizeToMS, html, nextPost, readNext, ref, rhythm;
ref = this.props.typography,
rhythm = ref.rhythm,
fontSizeToMS = ref.fontSizeToMS;

readNext = this.props.post.readNext;
if (readNext != null) {
nextPost = find(this.props.pages, function(page) {
Expand Down Expand Up @@ -53,4 +56,4 @@ module.exports = React.createClass({
);
}
}
});
}
18 changes: 6 additions & 12 deletions html.jsx
Expand Up @@ -2,17 +2,11 @@ import React from 'react';
import Typography from 'typography';
import DocumentTitle from 'react-document-title';

var TypographyStyle = new Typography().TypographyStyle;
let TypographyStyle = new Typography().TypographyStyle;

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

render: function() {
var title, urlPrefix;
export default class Html extends React.Component {
render() {
let title, urlPrefix;
title = DocumentTitle.rewind();
if (this.props.title) {
title = this.props.title;
Expand Down Expand Up @@ -56,6 +50,6 @@ module.exports = React.createClass({
</body>
</html>
);

}
});
}
Html.defaultProps = { body: "" };
12 changes: 6 additions & 6 deletions pages/_template.jsx
Expand Up @@ -4,14 +4,14 @@ 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;
let typography = new Typography();
let rhythm = typography.rhythm, fontSizeToMS = typography.fontSizeToMS;

import '../css/styles.css';

module.exports = React.createClass({
render: function() {
var header;
export default class extends React.Component {
render() {
let header;
if (this.props.state.path === link('/')) {
header = (
<h1
Expand Down Expand Up @@ -59,4 +59,4 @@ module.exports = React.createClass({
</Container>
);
}
});
}
22 changes: 10 additions & 12 deletions pages/index.jsx
Expand Up @@ -4,20 +4,18 @@ import sortBy from 'lodash/collection/sortBy';
import DocumentTitle from 'react-document-title';
import { link } from 'gatsby-helpers';

module.exports = React.createClass({
statics: {
data: function() {
return {
yo: true
};
export default class extends React.Component {
static data() {
return {
yo: true
}
},
render: function() {
var i, len, page, pageLinks, ref, ref1, ref2, rhythm, title;
}
render() {
let i, len, page, pageLinks, ref, ref1, ref2, rhythm, title;
rhythm = this.props.typography.rhythm;
pageLinks = [];
ref = sortBy(this.props.pages, function(page) {
var ref;
ref = sortBy(this.props.pages, (page) => {
let ref;
return (ref = page.data) != null ? ref.date : void 0;
}).reverse();
for (i = 0, len = ref.length; i < len; i++) {
Expand Down Expand Up @@ -63,4 +61,4 @@ module.exports = React.createClass({
</DocumentTitle>
);
}
});
}

0 comments on commit 950e386

Please sign in to comment.