diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index 0d9323687..1f72a2738 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -182,6 +182,7 @@ export default class Comment extends React.Component { editableUntil: PropTypes.string, }) }).isRequired, + setCommentStatus: PropTypes.func.isRequired, // edit a comment, passed (id, asset_id, { body }) editComment: PropTypes.func, @@ -343,7 +344,9 @@ export default class Comment extends React.Component { } = this.props; if (!highlighted && this.commentIsRejected(comment)) { - return ; + return { + this.props.setCommentStatus({commentId: comment.id, status: 'NONE'}); + }}/>; } if (this.commentIsIgnored(comment)) { diff --git a/client/coral-embed-stream/src/components/CommentTombstone.css b/client/coral-embed-stream/src/components/CommentTombstone.css index 6119a5cd8..a8caeec7a 100644 --- a/client/coral-embed-stream/src/components/CommentTombstone.css +++ b/client/coral-embed-stream/src/components/CommentTombstone.css @@ -3,4 +3,10 @@ text-align: center; padding: 1em; color: #3E4F71; +} + +.undo { + cursor: pointer; + text-decoration: underline; + margin-left: 5px; } \ No newline at end of file diff --git a/client/coral-embed-stream/src/components/CommentTombstone.js b/client/coral-embed-stream/src/components/CommentTombstone.js index cc3362563..4fb8eaaf6 100644 --- a/client/coral-embed-stream/src/components/CommentTombstone.js +++ b/client/coral-embed-stream/src/components/CommentTombstone.js @@ -24,6 +24,9 @@ class CommentTombstone extends React.Component {

{this.getCopy()} + {this.props.action === 'reject' && + Undo + }

); @@ -32,6 +35,7 @@ class CommentTombstone extends React.Component { CommentTombstone.propTypes = { action: PropTypes.string, + onUndo: PropTypes.func, }; export default CommentTombstone; diff --git a/client/coral-embed-stream/src/containers/Comment.js b/client/coral-embed-stream/src/containers/Comment.js index 694314bd7..1bdca0e1e 100644 --- a/client/coral-embed-stream/src/containers/Comment.js +++ b/client/coral-embed-stream/src/containers/Comment.js @@ -3,6 +3,7 @@ import React from 'react'; import Comment from '../components/Comment'; import {withFragments} from 'coral-framework/hocs'; import {getSlotFragmentSpreads} from 'coral-framework/utils'; +import {withSetCommentStatus} from 'coral-framework/graphql/mutations'; import {THREADING_LEVEL} from '../constants/stream'; import hoistStatics from 'recompose/hoistStatics'; import {nest} from '../graphql/utils'; @@ -130,6 +131,7 @@ const withCommentFragments = withFragments({ const enhance = compose( withAnimateEnter, withCommentFragments, + withSetCommentStatus, ); export default enhance(Comment);