diff --git a/client/coral-embed-stream/src/Comment.js b/client/coral-embed-stream/src/Comment.js
index 1bc44459b..93c89ffb0 100644
--- a/client/coral-embed-stream/src/Comment.js
+++ b/client/coral-embed-stream/src/Comment.js
@@ -30,7 +30,7 @@ class Comment extends React.Component {
// id of currently opened ReplyBox. tracked in Stream.js
activeReplyBox: PropTypes.string.isRequired,
- replyButtonHandler: PropTypes.func.isRequired,
+ setActiveReplyBox: PropTypes.func.isRequired,
refetch: PropTypes.func.isRequired,
showSignInDialog: PropTypes.func.isRequired,
postAction: PropTypes.func.isRequired,
@@ -77,7 +77,7 @@ class Comment extends React.Component {
addNotification,
showSignInDialog,
postAction,
- replyButtonHandler,
+ setActiveReplyBox,
activeReplyBox,
deleteAction
} = this.props;
@@ -104,7 +104,7 @@ class Comment extends React.Component {
replyButtonHandler(comment.id)}
+ onClick={() => setActiveReplyBox(comment.id)}
parentCommentId={parentId || comment.id}
currentUserId={currentUser && currentUser.id}
banned={false} />
@@ -131,9 +131,10 @@ class Comment extends React.Component {
activeReplyBox === comment.id
? {
- replyButtonHandler('');
+ setActiveReplyBox('');
refetch();
}}
+ setActiveReplyBox={setActiveReplyBox}
parentId={parentId || comment.id}
addNotification={addNotification}
authorId={currentUser.id}
@@ -146,7 +147,7 @@ class Comment extends React.Component {
comment.replies.map(reply => {
return {
return this.setActiveReplyBox(comment.id)}
+ setActiveReplyBox={this.setActiveReplyBox}
activeReplyBox={this.state.activeReplyBox}
addNotification={addNotification}
depth={0}
diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js
index f368953a7..258681a08 100644
--- a/client/coral-plugin-commentbox/CommentBox.js
+++ b/client/coral-plugin-commentbox/CommentBox.js
@@ -13,6 +13,7 @@ class CommentBox extends Component {
// comments: PropTypes.array,
commentPostedHandler: PropTypes.func,
postItem: PropTypes.func.isRequired,
+ cancelButtonClicked: PropTypes.func,
assetId: PropTypes.string.isRequired,
parentId: PropTypes.string,
authorId: PropTypes.string.isRequired,
@@ -89,7 +90,14 @@ class CommentBox extends Component {
render () {
const {styles, isReply, authorId, charCount} = this.props;
+ let {cancelButtonClicked} = this.props;
const length = this.state.body.length;
+
+ if (isReply && typeof cancelButtonClicked !== 'function') {
+ console.warn('the CommentBox component should have a cancelButtonClicked callback defined if it lives in a Reply');
+ cancelButtonClicked = () => {};
+ }
+
return
@@ -115,6 +123,19 @@ class CommentBox extends Component {
}
+ {
+ isReply && (
+
+ )
+ }
{ authorId && (