diff --git a/src/core/client/stream/queries/CommentsCountQuery.tsx b/src/core/client/stream/queries/CommentsCountQuery.tsx index f589a26fc..e781f3e59 100644 --- a/src/core/client/stream/queries/CommentsCountQuery.tsx +++ b/src/core/client/stream/queries/CommentsCountQuery.tsx @@ -39,7 +39,7 @@ class CommentsCountQuery extends Component { return
{error.message}
; } - if (props && props.asset && props.asset.commentCounts.totalVisible) { + if (props && props.asset) { return ( { const { totalReactions, reacted } = this.props; return ( ); } diff --git a/src/core/client/stream/tabs/comments/containers/CommentContainer.tsx b/src/core/client/stream/tabs/comments/containers/CommentContainer.tsx index cca9cd3cd..2ca29a7fd 100644 --- a/src/core/client/stream/tabs/comments/containers/CommentContainer.tsx +++ b/src/core/client/stream/tabs/comments/containers/CommentContainer.tsx @@ -140,6 +140,7 @@ export class CommentContainer extends Component { localReply, disableReplies, showConversationLink, + me, } = this.props; const { showReplyDialog, showEditDialog, editable } = this.state; if (showEditDialog) { @@ -186,12 +187,11 @@ export class CommentContainer extends Component { /> )} - {this.props.me && ( - - )} + {showConversationLink && ( { + private handleSignIn = () => this.props.showAuthPopup({ view: "SIGN_IN" }); + private handleClick = () => { + if (this.props.me === null) { + return this.handleSignIn(); + } + const input = { commentID: this.props.comment.id, }; @@ -32,7 +46,9 @@ class ReactionButtonContainer extends React.Component< this.props.comment.myActionPresence && this.props.comment.myActionPresence.reaction; - reacted ? deleteCommentReaction(input) : createCommentReaction(input); + return reacted + ? deleteCommentReaction(input) + : createCommentReaction(input); }; public render() { const { @@ -62,32 +78,39 @@ class ReactionButtonContainer extends React.Component< } } -export default withDeleteCommentReactionMutation( - withCreateCommentReactionMutation( - withFragmentContainer({ - comment: graphql` - fragment ReactionButtonContainer_comment on Comment { - id - myActionPresence { - reaction +export default withShowAuthPopupMutation( + withDeleteCommentReactionMutation( + withCreateCommentReactionMutation( + withFragmentContainer({ + me: graphql` + fragment ReactionButtonContainer_me on User { + id } - actionCounts { - reaction { - total + `, + comment: graphql` + fragment ReactionButtonContainer_comment on Comment { + id + myActionPresence { + reaction + } + actionCounts { + reaction { + total + } } } - } - `, - settings: graphql` - fragment ReactionButtonContainer_settings on Settings { - reaction { - label - labelActive - icon - iconActive + `, + settings: graphql` + fragment ReactionButtonContainer_settings on Settings { + reaction { + label + labelActive + icon + iconActive + } } - } - `, - })(ReactionButtonContainer) + `, + })(ReactionButtonContainer) + ) ) ); diff --git a/src/core/client/stream/tabs/comments/containers/__snapshots__/CommentContainer.spec.tsx.snap b/src/core/client/stream/tabs/comments/containers/__snapshots__/CommentContainer.spec.tsx.snap index b8fc25583..5c96e25d7 100644 --- a/src/core/client/stream/tabs/comments/containers/__snapshots__/CommentContainer.spec.tsx.snap +++ b/src/core/client/stream/tabs/comments/containers/__snapshots__/CommentContainer.spec.tsx.snap @@ -18,6 +18,33 @@ exports[`hide reply button 1`] = ` + } @@ -51,6 +78,33 @@ exports[`renders body only 1`] = ` + } @@ -84,6 +138,33 @@ exports[`renders username and body 1`] = ` + } @@ -117,6 +198,34 @@ exports[`shows conversation link 1`] = ` + + @@ -320,6 +335,21 @@ exports[`loads more comments 1`] = ` Reply + @@ -394,6 +424,21 @@ exports[`loads more comments 1`] = ` Reply + @@ -652,6 +697,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -726,6 +786,21 @@ exports[`renders comment stream 1`] = ` Reply + diff --git a/src/core/client/stream/test/comments/__snapshots__/permalinkView.spec.tsx.snap b/src/core/client/stream/test/comments/__snapshots__/permalinkView.spec.tsx.snap index dc408c24e..49a759525 100644 --- a/src/core/client/stream/test/comments/__snapshots__/permalinkView.spec.tsx.snap +++ b/src/core/client/stream/test/comments/__snapshots__/permalinkView.spec.tsx.snap @@ -121,6 +121,21 @@ exports[`renders permalink view 1`] = ` Reply + @@ -377,6 +392,21 @@ exports[`show all comments 1`] = ` Reply + diff --git a/src/core/client/stream/test/comments/__snapshots__/permalinkViewCommentNotFound.spec.tsx.snap b/src/core/client/stream/test/comments/__snapshots__/permalinkViewCommentNotFound.spec.tsx.snap index a38d7cbb8..d6e998281 100644 --- a/src/core/client/stream/test/comments/__snapshots__/permalinkViewCommentNotFound.spec.tsx.snap +++ b/src/core/client/stream/test/comments/__snapshots__/permalinkViewCommentNotFound.spec.tsx.snap @@ -312,6 +312,21 @@ exports[`show all comments 1`] = ` Reply + diff --git a/src/core/client/stream/test/comments/__snapshots__/renderReplies.spec.tsx.snap b/src/core/client/stream/test/comments/__snapshots__/renderReplies.spec.tsx.snap index e527a8b9d..078aeb205 100644 --- a/src/core/client/stream/test/comments/__snapshots__/renderReplies.spec.tsx.snap +++ b/src/core/client/stream/test/comments/__snapshots__/renderReplies.spec.tsx.snap @@ -246,6 +246,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -320,6 +335,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -398,6 +428,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -476,6 +521,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -550,6 +610,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -626,6 +701,21 @@ exports[`renders comment stream 1`] = ` Reply + diff --git a/src/core/client/stream/test/comments/__snapshots__/renderStream.spec.tsx.snap b/src/core/client/stream/test/comments/__snapshots__/renderStream.spec.tsx.snap index dd39c45e0..232eeaee8 100644 --- a/src/core/client/stream/test/comments/__snapshots__/renderStream.spec.tsx.snap +++ b/src/core/client/stream/test/comments/__snapshots__/renderStream.spec.tsx.snap @@ -246,6 +246,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -320,6 +335,21 @@ exports[`renders comment stream 1`] = ` Reply + diff --git a/src/core/client/stream/test/comments/__snapshots__/showAllReplies.spec.tsx.snap b/src/core/client/stream/test/comments/__snapshots__/showAllReplies.spec.tsx.snap index 233b7810d..df74cf1da 100644 --- a/src/core/client/stream/test/comments/__snapshots__/showAllReplies.spec.tsx.snap +++ b/src/core/client/stream/test/comments/__snapshots__/showAllReplies.spec.tsx.snap @@ -246,6 +246,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -324,6 +339,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -608,6 +638,21 @@ exports[`show all replies 1`] = ` Reply + @@ -686,6 +731,21 @@ exports[`show all replies 1`] = ` Reply + @@ -760,6 +820,21 @@ exports[`show all replies 1`] = ` Reply + diff --git a/src/core/client/stream/test/comments/__snapshots__/showConversation.spec.tsx.snap b/src/core/client/stream/test/comments/__snapshots__/showConversation.spec.tsx.snap index 6fbd0d02b..1b7acac67 100644 --- a/src/core/client/stream/test/comments/__snapshots__/showConversation.spec.tsx.snap +++ b/src/core/client/stream/test/comments/__snapshots__/showConversation.spec.tsx.snap @@ -246,6 +246,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -324,6 +339,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -402,6 +432,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -480,6 +525,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -558,6 +618,21 @@ exports[`renders comment stream 1`] = ` Reply + @@ -636,6 +711,21 @@ exports[`renders comment stream 1`] = ` Reply + +