diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 2a02409..0000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "stage": 2, -} diff --git a/components/ReadNext.jsx b/components/ReadNext.jsx index 5c517f7..ea98c3c 100644 --- a/components/ReadNext.jsx +++ b/components/ReadNext.jsx @@ -1,22 +1,16 @@ import React from 'react' import { Link } from 'react-router' import { prune, include as includes } from 'underscore.string' -import find from 'lodash/collection/find' +import find from 'lodash/find' import { rhythm, fontSizeToMS } from 'utils/typography' -export default class ReadNext extends React.Component { - propTypes () { - return { - post: React.PropTypes.object, - pages: React.PropTypes.object, - } - } +class ReadNext extends React.Component { render () { const readNext = this.props.post.readNext let nextPost - if (readNext !== null) { + if (readNext) { nextPost = find(this.props.pages, (page) => - includes(page.path, readNext.slice(1, -1)) + includes(page.path, readNext) ) } if (!nextPost) { @@ -47,8 +41,12 @@ export default class ReadNext extends React.Component { }} > {nextPost.data.title} @@ -60,3 +58,10 @@ export default class ReadNext extends React.Component { } } } + +ReadNext.propTypes = { + post: React.PropTypes.object.isRequired, + pages: React.PropTypes.array, +} + +export default ReadNext diff --git a/package.json b/package.json index 8c0e770..0ddfa8a 100644 --- a/package.json +++ b/package.json @@ -21,20 +21,24 @@ }, "homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme", "dependencies": { - "lodash": "^3.10.1", + "lodash": "^4.5.0", "moment": "^2.10.3", - "react": "^0.14.3", + "react": "^0.14.7", "react-document-title": "^2.0.1", - "react-dom": "^0.14.3", + "react-dom": "^0.14.7", "react-responsive-grid": "^0.3.0", - "react-router": "^0.13.5", + "react-router": "^2.0.0", "safe-access": "^0.1.0", - "typography": "^0.6.2", + "typography": "^0.7.0", "underscore.string": "^3.2.2" }, "devDependencies": { + "babel-plugin-react-transform": "^1.1.1", "eslint": "^1.10.3", "eslint-config-airbnb": "^5.0.1", - "eslint-plugin-react": "^4.0.0" + "eslint-plugin-react": "^4.0.0", + "react-transform-catch-errors": "^1.0.0", + "react-transform-hmr": "^1.0.0", + "redbox-react": "^1.0.1" } } diff --git a/pages/_template.jsx b/pages/_template.jsx index dd3706f..9cb7b87 100644 --- a/pages/_template.jsx +++ b/pages/_template.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { RouteHandler, Link } from 'react-router' +import { Link } from 'react-router' import { Container } from 'react-responsive-grid' import { link } from 'gatsby-helpers' import { rhythm, fontSizeToMS } from 'utils/typography' @@ -7,15 +7,10 @@ import { config } from 'config' import '../css/styles.css' -export default class extends React.Component { - propTypes () { - return { - route: React.PropTypes.object, - } - } +class Template extends React.Component { render () { let header - if (this.props.route.path === link('/')) { + if (this.props.location.pathname === link('/')) { header = (
- {this.props.config.authorName} lives and works in San Francisco building useful things. You should follow him on Twitter
+ {config.authorName} lives and works in San Francisco building useful things. You should follow him on Twitter