2016-02-15 22:33:44 +09:00
|
|
|
const Post = (props) => {
|
2016-02-18 16:26:52 +09:00
|
|
|
|
2016-02-16 16:12:13 +09:00
|
|
|
({ListContainer, CommentList} = Telescope.components);
|
2016-02-18 16:26:52 +09:00
|
|
|
|
|
|
|
const htmlBody = {__html: props.htmlBody};
|
|
|
|
|
2016-02-15 22:33:44 +09:00
|
|
|
return (
|
|
|
|
<div className="post">
|
2016-02-18 16:26:52 +09:00
|
|
|
|
2016-02-15 22:33:44 +09:00
|
|
|
<h3>{props.title}</h3>
|
2016-02-16 16:12:13 +09:00
|
|
|
<p>{props.commentCount} comments</p>
|
2016-02-15 22:33:44 +09:00
|
|
|
<p>{moment(props.postedAt).fromNow()}</p>
|
2016-02-18 16:26:52 +09:00
|
|
|
<div dangerouslySetInnerHTML={htmlBody}></div>
|
|
|
|
|
2016-02-16 16:12:13 +09:00
|
|
|
<div className="comments-thread">
|
|
|
|
<h4>Comments</h4>
|
2016-02-18 16:26:52 +09:00
|
|
|
<ListContainer
|
|
|
|
collection={Comments}
|
|
|
|
publication="comments.list"
|
|
|
|
selector={{postId: props._id}}
|
|
|
|
terms={{postId: props._id, view: "postComments"}}
|
|
|
|
component={CommentList}
|
|
|
|
limit={0}
|
|
|
|
/>
|
2016-02-16 16:12:13 +09:00
|
|
|
</div>
|
2016-02-18 16:26:52 +09:00
|
|
|
|
2016-02-15 22:33:44 +09:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Post;
|