From b67ac375ba68283da4f160931a472a2177823043 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 27 Jun 2017 22:14:06 +0700 Subject: [PATCH] Pass current user to CommentBox --- client/coral-embed-stream/src/components/Comment.js | 2 +- client/coral-embed-stream/src/components/Stream.js | 2 +- client/coral-plugin-commentbox/CommentBox.js | 6 +++--- client/coral-plugin-replies/ReplyBox.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index 2178e6c44..bfa629047 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -557,8 +557,8 @@ export default class Comment extends React.Component { setActiveReplyBox={setActiveReplyBox} parentId={parentId || comment.id} addNotification={addNotification} - authorId={currentUser.id} postComment={postComment} + currentUser={currentUser} assetId={asset.id} /> : null} diff --git a/client/coral-embed-stream/src/components/Stream.js b/client/coral-embed-stream/src/components/Stream.js index 457880a94..165b3ce4c 100644 --- a/client/coral-embed-stream/src/components/Stream.js +++ b/client/coral-embed-stream/src/components/Stream.js @@ -224,7 +224,7 @@ class Stream extends React.Component { assetId={asset.id} premod={asset.settings.moderation} isReply={false} - authorId={user.id} + currentUser={user} charCountEnable={asset.settings.charCountEnable} maxCharCount={asset.settings.charCount} />} diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index c05f7bda0..efa1d27ed 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -133,7 +133,7 @@ class CommentBox extends React.Component { handleChange = (e) => this.setState({body: e.target.value}); render () { - const {styles, isReply, authorId, maxCharCount} = this.props; + const {styles, isReply, currentUser, maxCharCount} = this.props; let {cancelButtonClicked} = this.props; if (isReply && typeof cancelButtonClicked !== 'function') { @@ -152,7 +152,7 @@ class CommentBox extends React.Component { charCountEnable={this.props.charCountEnable} bodyPlaceholder={t('comment.comment')} bodyInputId={isReply ? 'replyText' : 'commentText'} - saveComment={authorId && this.postComment} + saveComment={currentUser && this.postComment} buttonContainerStart={