2016-08-08 11:18:21 +09:00
|
|
|
import Telescope from 'meteor/nova:lib';
|
2016-03-30 09:24:52 +09:00
|
|
|
import React from 'react';
|
2016-11-11 16:42:19 +09:00
|
|
|
import Posts from 'meteor/nova:posts';
|
|
|
|
import { withPostsSingle } from 'meteor/nova:base-containers';
|
2016-04-03 11:42:07 +09:00
|
|
|
|
2016-10-27 15:29:15 +09:00
|
|
|
const PostsPage = (props) => {
|
2016-02-18 16:26:52 +09:00
|
|
|
|
2016-11-11 16:42:19 +09:00
|
|
|
if (props.data.loading) {
|
2016-02-18 16:26:52 +09:00
|
|
|
|
2016-11-11 16:42:19 +09:00
|
|
|
return <div className="posts-page"><Telescope.components.Loading/></div>
|
2016-02-18 16:26:52 +09:00
|
|
|
|
2016-11-11 16:42:19 +09:00
|
|
|
} else {
|
2016-03-22 10:38:57 +09:00
|
|
|
|
2016-11-11 16:42:19 +09:00
|
|
|
const post = props.data.post;
|
|
|
|
const htmlBody = {__html: post.htmlBody};
|
2016-03-22 10:38:57 +09:00
|
|
|
|
2016-11-11 16:42:19 +09:00
|
|
|
return (
|
|
|
|
<div className="posts-page">
|
|
|
|
<Telescope.components.HeadTags url={Posts.getLink(post)} title={post.title} image={post.thumbnailUrl} />
|
|
|
|
|
|
|
|
<Telescope.components.PostsItem post={post} />
|
2016-02-18 16:26:52 +09:00
|
|
|
|
2016-11-11 16:42:19 +09:00
|
|
|
{post.htmlBody ? <div className="posts-page-body" dangerouslySetInnerHTML={htmlBody}></div> : null}
|
2016-02-18 16:26:52 +09:00
|
|
|
|
2016-11-11 16:42:19 +09:00
|
|
|
{/*<SocialShare url={ Posts.getLink(post) } title={ post.title }/>*/}
|
|
|
|
|
|
|
|
<Telescope.components.PostsCommentsThread postId={post._id} />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
2016-04-02 15:03:55 +02:00
|
|
|
};
|
2016-02-15 22:33:44 +09:00
|
|
|
|
2016-05-22 16:42:24 +09:00
|
|
|
PostsPage.displayName = "PostsPage";
|
|
|
|
|
2016-11-03 14:07:58 +09:00
|
|
|
PostsPage.propTypes = {
|
2016-11-07 16:33:52 +01:00
|
|
|
document: React.PropTypes.object
|
2016-11-03 14:07:58 +09:00
|
|
|
}
|
|
|
|
|
2016-11-11 18:19:18 +09:00
|
|
|
module.exports = withPostsSingle()(PostsPage);
|
|
|
|
export default withPostsSingle()(PostsPage);
|