mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
40 lines
No EOL
1.3 KiB
JavaScript
40 lines
No EOL
1.3 KiB
JavaScript
import Telescope from 'meteor/nova:lib';
|
|
import React from 'react';
|
|
import {FormattedMessage } from 'react-intl';
|
|
import { ModalTrigger } from "meteor/nova:core";
|
|
import Comments from "meteor/nova:comments";
|
|
|
|
const PostsCommentsThread = ({document, refetchQuery}, {currentUser}) => {
|
|
|
|
const post = document;
|
|
|
|
return (
|
|
<div className="posts-comments-thread">
|
|
<h4 className="posts-comments-thread-title"><FormattedMessage id="comments.comments"/></h4>
|
|
<Telescope.components.CommentsList comments={post.comments} commentCount={post.commentCount} />
|
|
{ currentUser ?
|
|
<div className="posts-comments-thread-new">
|
|
<h4><FormattedMessage id="comments.new"/></h4>
|
|
<Telescope.components.CommentsNewFormContainer
|
|
component={Telescope.components.CommentsNewForm}
|
|
postId={post._id}
|
|
type="comment"
|
|
/>
|
|
</div> :
|
|
<div>
|
|
<ModalTrigger size="small" component={<a><FormattedMessage id="comments.please_log_in"/></a>}>
|
|
<Telescope.components.UsersAccountForm/>
|
|
</ModalTrigger>
|
|
</div> }
|
|
</div>
|
|
)
|
|
};
|
|
|
|
PostsCommentsThread.displayName = "PostsCommentsThread";
|
|
|
|
PostsCommentsThread.contextTypes = {
|
|
currentUser: React.PropTypes.object
|
|
};
|
|
|
|
module.exports = PostsCommentsThread;
|
|
export default PostsCommentsThread; |