refactor: fixes linting errors components/SitePost/index.jsx

This commit is contained in:
Simon Reinsperger 2017-03-08 17:37:27 +01:00
parent 54642a6757
commit 923a226d9d

View File

@ -1,42 +1,41 @@
import React from 'react'
import moment from 'moment'
import { RouteHandler, Link } from 'react-router'
import { prefixLink } from 'gatsby-helpers'
import access from 'safe-access'
import { config } from 'config'
import ReadNext from '../ReadNext'
import './style.css'
import '../../static/css/highlight.css'
import React from 'react';
import moment from 'moment';
import { Link } from 'react-router';
import { prefixLink } from 'gatsby-helpers';
import { config } from 'config';
import ReadNext from '../ReadNext';
import './style.css';
import '../../static/css/highlight.css';
class SitePost extends React.Component {
render() {
const {route} = this.props
const post = route.page.data
const { route } = this.props;
const post = route.page.data;
const home = (
<div>
<Link className='gohome' to={ prefixLink('/') }> All Articles
</Link>
<Link className="gohome" to={prefixLink('/')}>All Articles</Link>
</div>
)
);
return (
<div>
{ home }
<div className='blog-single'>
<div className='text'>
<h1>{ post.title }</h1>
<div dangerouslySetInnerHTML={ { __html: post.body} } />
<div className='date-published'>
<em>Published { moment(post.date).format('D MMM YYYY') }</em>
{home}
<div className="blog-single">
<div className="text">
<h1>{post.title}</h1>
<div dangerouslySetInnerHTML={{ __html: post.body }} />
<div className="date-published">
<em>Published {moment(post.date).format('D MMM YYYY')}</em>
</div>
</div>
<div className='footer'>
<ReadNext post={ post } {...this.props}/>
<hr></hr>
<div className="footer">
<ReadNext post={post} {...this.props} />
<hr />
<p>
{ config.siteDescr }
<a href={ config.siteTwitterUrl }>
<br></br> <strong>{ config.siteAuthor }</strong> on Twitter</a>
{config.siteDescr}
<a href={config.siteTwitterUrl}>
<br /> <strong>{config.siteAuthor}</strong> on Twitter
</a>
</p>
</div>
</div>
@ -46,7 +45,7 @@ class SitePost extends React.Component {
}
SitePost.propTypes = {
route: React.PropTypes.object.isRequired
}
route: React.PropTypes.object.isRequired,
};
export default SitePost
export default SitePost;