2016-02-15 22:33:44 +09:00
|
|
|
const Post = (props) => {
|
2016-02-16 16:12:13 +09:00
|
|
|
({ListContainer, CommentList} = Telescope.components);
|
2016-02-15 22:33:44 +09:00
|
|
|
return (
|
|
|
|
<div className="post">
|
|
|
|
<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>
|
|
|
|
<p>{props.body}</p>
|
2016-02-16 16:12:13 +09:00
|
|
|
<div className="comments-thread">
|
|
|
|
<h4>Comments</h4>
|
|
|
|
<ListContainer collection={Comments} publication="comments.list" terms={{postId: props._id, view: "postComments"}} component={CommentList} limit={0}/>
|
|
|
|
</div>
|
2016-02-15 22:33:44 +09:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Post;
|