updated html.jsx to es6
This commit is contained in:
parent
0a4ebe5e10
commit
e68ae6737c
2 changed files with 11 additions and 14 deletions
|
|
@ -5,8 +5,11 @@ import find from 'lodash/collection/find';
|
||||||
|
|
||||||
export default class extends React.Component {
|
export default class extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
var body, fontSizeToMS, html, nextPost, readNext, ref, rhythm;
|
let body, fontSizeToMS, html, nextPost, readNext, ref, rhythm;
|
||||||
ref = this.props.typography, rhythm = ref.rhythm, fontSizeToMS = ref.fontSizeToMS;
|
ref = this.props.typography,
|
||||||
|
rhythm = ref.rhythm,
|
||||||
|
fontSizeToMS = ref.fontSizeToMS;
|
||||||
|
|
||||||
readNext = this.props.post.readNext;
|
readNext = this.props.post.readNext;
|
||||||
if (readNext != null) {
|
if (readNext != null) {
|
||||||
nextPost = find(this.props.pages, function(page) {
|
nextPost = find(this.props.pages, function(page) {
|
||||||
|
|
|
||||||
18
html.jsx
18
html.jsx
|
|
@ -2,17 +2,11 @@ import React from 'react';
|
||||||
import Typography from 'typography';
|
import Typography from 'typography';
|
||||||
import DocumentTitle from 'react-document-title';
|
import DocumentTitle from 'react-document-title';
|
||||||
|
|
||||||
var TypographyStyle = new Typography().TypographyStyle;
|
let TypographyStyle = new Typography().TypographyStyle;
|
||||||
|
|
||||||
module.exports = React.createClass({
|
export default class Html extends React.Component {
|
||||||
getDefaultProps: function() {
|
render() {
|
||||||
return {
|
let title, urlPrefix;
|
||||||
body: ""
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
|
||||||
var title, urlPrefix;
|
|
||||||
title = DocumentTitle.rewind();
|
title = DocumentTitle.rewind();
|
||||||
if (this.props.title) {
|
if (this.props.title) {
|
||||||
title = this.props.title;
|
title = this.props.title;
|
||||||
|
|
@ -56,6 +50,6 @@ module.exports = React.createClass({
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
Html.defaultProps = { body: "" };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue