mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-26 14:59:14 +01:00
refactor: fixes linting errors components/SitePost/index.jsx
This commit is contained in:
parent
54642a6757
commit
923a226d9d
@ -1,52 +1,51 @@
|
||||
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 home = (
|
||||
<div>
|
||||
<Link className='gohome' to={ prefixLink('/') }> All Articles
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
render() {
|
||||
const { route } = this.props;
|
||||
const post = route.page.data;
|
||||
const home = (
|
||||
<div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div className='footer'>
|
||||
<ReadNext post={ post } {...this.props}/>
|
||||
<hr></hr>
|
||||
<p>
|
||||
{ config.siteDescr }
|
||||
<a href={ config.siteTwitterUrl }>
|
||||
<br></br> <strong>{ config.siteAuthor }</strong> on Twitter</a>
|
||||
</p>
|
||||
</div>
|
||||
</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>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
</div>
|
||||
<div className="footer">
|
||||
<ReadNext post={post} {...this.props} />
|
||||
<hr />
|
||||
<p>
|
||||
{config.siteDescr}
|
||||
<a href={config.siteTwitterUrl}>
|
||||
<br /> <strong>{config.siteAuthor}</strong> on Twitter
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
SitePost.propTypes = {
|
||||
route: React.PropTypes.object.isRequired
|
||||
}
|
||||
route: React.PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default SitePost
|
||||
export default SitePost;
|
||||
|
Loading…
Reference in New Issue
Block a user