From e68ae6737c66c777190143b17ef07fa9413f4dac Mon Sep 17 00:00:00 2001 From: Luandro Date: Wed, 7 Oct 2015 09:03:10 -0300 Subject: [PATCH] updated html.jsx to es6 --- components/ReadNext.jsx | 7 +++++-- html.jsx | 18 ++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/components/ReadNext.jsx b/components/ReadNext.jsx index 06f402b..2dda8a0 100644 --- a/components/ReadNext.jsx +++ b/components/ReadNext.jsx @@ -5,8 +5,11 @@ import find from 'lodash/collection/find'; export default class extends React.Component { render() { - var body, fontSizeToMS, html, nextPost, readNext, ref, rhythm; - ref = this.props.typography, rhythm = ref.rhythm, fontSizeToMS = ref.fontSizeToMS; + 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) { diff --git a/html.jsx b/html.jsx index 3552b2d..ee98186 100644 --- a/html.jsx +++ b/html.jsx @@ -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; @@ -56,6 +50,6 @@ module.exports = React.createClass({ ); - } -}); +} +Html.defaultProps = { body: "" };