Vulcan/packages/nova-base-components/lib/posts/PostsPage.jsx

42 lines
1.1 KiB
React
Raw Normal View History

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