@@ -14,11 +27,11 @@ class IgnoredCommentTombstone extends React.Component {
padding: '1em',
color: '#3E4F71',
}}>
- {t('framework.comment_is_ignored')}
+ {this.getCopy()}
);
}
}
-export default IgnoredCommentTombstone;
+export default CommentTombstone;
diff --git a/client/coral-framework/graphql/mutations.js b/client/coral-framework/graphql/mutations.js
index c09ce8751..fb004956b 100644
--- a/client/coral-framework/graphql/mutations.js
+++ b/client/coral-framework/graphql/mutations.js
@@ -127,6 +127,27 @@ export const withSetCommentStatus = withMutation(
commentId,
status,
},
+ optimisticResponse: {
+ setCommentStatus: {
+ __typename: 'SetCommentStatusResponse',
+ errors: null,
+ }
+ },
+ update: (proxy) => {
+
+ const fragment = gql`
+ fragment Talk_SetCommentStatus on Comment {
+ status
+ }`;
+
+ const fragmentId = `Comment_${commentId}`;
+
+ const data = proxy.readFragment({fragment, id: fragmentId});
+
+ data.status = status;
+
+ proxy.writeFragment({fragment, id: fragmentId, data});
+ }
});
}
})
diff --git a/locales/en.yml b/locales/en.yml
index 4d215fd06..703de4b28 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -221,6 +221,8 @@ en:
banned_account_body: "This means that you cannot Like, Report, or write comments."
comment: comment
comment_is_ignored: "This comment is hidden because you ignored this user."
+ comment_is_rejected: "You have rejected this comment."
+ comment_is_hidden: "This comment is not available."
comments: comments
configure_stream: "Configure"
content_not_available: "This content is not available"
diff --git a/locales/es.yml b/locales/es.yml
index f9b675a10..db25ab527 100644
--- a/locales/es.yml
+++ b/locales/es.yml
@@ -219,6 +219,8 @@ es:
banned_account_body: "Esto significa que no puedes gustar, marcar o escribir comentarios."
comment: "comentario"
comment_is_ignored: "Este comentario está escondido porque has ignorado al usuario."
+ comment_is_rejected: "Has rechazado este comentario."
+ comment_is_hidden: "Este comentario no está disponible."
comments: "comentarios"
configure_stream: "Configurar Hilo de Comentarios"
content_not_available: "Este contenido no se encuentra disponible"
diff --git a/plugin-api/beta/client/hocs/index.js b/plugin-api/beta/client/hocs/index.js
index 15c8b3544..d6d5a67a0 100644
--- a/plugin-api/beta/client/hocs/index.js
+++ b/plugin-api/beta/client/hocs/index.js
@@ -8,4 +8,5 @@ export {default as withEmit} from 'coral-framework/hocs/withEmit';
export {
withIgnoreUser,
withStopIgnoringUser,
+ withSetCommentStatus,
} from 'coral-framework/graphql/mutations';
diff --git a/plugins/talk-plugin-featured-comments/client/components/Button.css b/plugins/talk-plugin-featured-comments/client/components/Button.css
index daaa329c9..09432af70 100644
--- a/plugins/talk-plugin-featured-comments/client/components/Button.css
+++ b/plugins/talk-plugin-featured-comments/client/components/Button.css
@@ -14,4 +14,4 @@
.icon {
font-size: 18px;
vertical-align: top;
-}
+}
\ No newline at end of file
diff --git a/plugins/talk-plugin-featured-comments/client/components/Button.js b/plugins/talk-plugin-featured-comments/client/components/Button.js
index b9d0cc95f..c581ce027 100644
--- a/plugins/talk-plugin-featured-comments/client/components/Button.js
+++ b/plugins/talk-plugin-featured-comments/client/components/Button.js
@@ -24,4 +24,3 @@ const Button = (props) => {
};
export default withTags('featured')(Button);
-
diff --git a/plugins/talk-plugin-featured-comments/client/components/Comment.js b/plugins/talk-plugin-featured-comments/client/components/Comment.js
index ada7ae7b6..1c2045110 100644
--- a/plugins/talk-plugin-featured-comments/client/components/Comment.js
+++ b/plugins/talk-plugin-featured-comments/client/components/Comment.js
@@ -5,6 +5,7 @@ import {t, timeago} from 'plugin-api/beta/client/services';
import {Slot, CommentAuthorName} from 'plugin-api/beta/client/components';
import {Icon} from 'plugin-api/beta/client/components/ui';
import {pluginName} from '../../package.json';
+import Button from './Button';
class Comment extends React.Component {
@@ -48,6 +49,13 @@ class Comment extends React.Component {
asset={asset}
inline
/>
+
+