diff --git a/client/coral-embed-stream/src/CommentStream.js b/client/coral-embed-stream/src/CommentStream.js index 26142a311..3f94f879a 100644 --- a/client/coral-embed-stream/src/CommentStream.js +++ b/client/coral-embed-stream/src/CommentStream.js @@ -82,6 +82,7 @@ class CommentStream extends Component { const {actions, users, comments} = this.props.items; const {loggedIn, user, showSignInDialog} = this.props.auth; const {activeTab} = this.state; + const banned = (this.props.userData.status === 'banned'); return
{ @@ -92,14 +93,13 @@ class CommentStream extends Component { Settings {loggedIn && } - {/* Add to the restricted param a boolean if the user is suspended*/} - }> - -
- + +
+ + }> - {!loggedIn && } -
- { - rootItem.comments && rootItem.comments.map((commentId) => { - const comment = comments[commentId]; - return
-
- - - -
+ + {!loggedIn && } +
+ { + rootItem.comments && rootItem.comments.map((commentId) => { + const comment = comments[commentId]; + return
+
+ + + +
+ showReply={comment.showReply} + banned={banned}/> -
-
- - -
- +
+
+ - { - comment.children && - comment.children.map((replyId) => { - let reply = this.props.items.comments[replyId]; - return
-
- - - -
- - -
-
- - -
- + +
+ + { + comment.children && + comment.children.map((replyId) => { + let reply = this.props.items.comments[replyId]; + return
+
+ + + +
+ -
; - }) - } -
; - }) - } - - + +
+
+ + +
+ +
; + }) + } +
; + }) + } +
+ {!loggedIn && } -
( - {lang.t('suspendedAccountMsg')} +
+ {lang.t('suspendedAccountMsg')} +
); diff --git a/client/coral-plugin-flags/FlagButton.js b/client/coral-plugin-flags/FlagButton.js index cbb0fef63..daf7569c8 100644 --- a/client/coral-plugin-flags/FlagButton.js +++ b/client/coral-plugin-flags/FlagButton.js @@ -4,12 +4,15 @@ import translations from './translations.json'; const name = 'coral-plugin-flags'; -const FlagButton = ({flag, id, postAction, deleteAction, addItem, updateItem, addNotification, currentUser}) => { +const FlagButton = ({flag, id, postAction, deleteAction, addItem, updateItem, addNotification, currentUser, banned}) => { const flagged = flag && flag.current_user; const onFlagClick = () => { if (!currentUser) { return; } + if (banned) { + return; + } if (!flagged) { postAction(id, 'flag', currentUser.id, 'comments') .then((action) => { diff --git a/client/coral-plugin-likes/LikeButton.js b/client/coral-plugin-likes/LikeButton.js index 07f27c426..4f20d0804 100644 --- a/client/coral-plugin-likes/LikeButton.js +++ b/client/coral-plugin-likes/LikeButton.js @@ -4,12 +4,15 @@ import translations from './translations.json'; const name = 'coral-plugin-flags'; -const LikeButton = ({like, id, postAction, deleteAction, addItem, updateItem, currentUser}) => { +const LikeButton = ({like, id, postAction, deleteAction, addItem, updateItem, currentUser, banned}) => { const liked = like && like.current_user; const onLikeClick = () => { if (!currentUser) { return; } + if (banned) { + return; + } if (!liked) { postAction(id, 'like', currentUser.id, 'comments') .then((action) => { diff --git a/client/coral-plugin-replies/ReplyButton.js b/client/coral-plugin-replies/ReplyButton.js index 8e39af663..c44012cdb 100644 --- a/client/coral-plugin-replies/ReplyButton.js +++ b/client/coral-plugin-replies/ReplyButton.js @@ -6,7 +6,12 @@ const name = 'coral-plugin-replies'; const ReplyButton = (props) =>