diff --git a/client/coral-admin/src/components/Comment.js b/client/coral-admin/src/components/Comment.js index fa94f74a4..bd97bee10 100644 --- a/client/coral-admin/src/components/Comment.js +++ b/client/coral-admin/src/components/Comment.js @@ -22,6 +22,7 @@ export default props => ( onClick={() => props.onClickAction(props.actionsMap[action].status, props.comment.get('id'))} fab colored> + ) : null)} diff --git a/client/coral-admin/src/components/CommentList.js b/client/coral-admin/src/components/CommentList.js index e965dc38b..3e4ae45cd 100644 --- a/client/coral-admin/src/components/CommentList.js +++ b/client/coral-admin/src/components/CommentList.js @@ -10,7 +10,7 @@ const actions = { 'reject': {status: 'rejected', icon: 'close', key: 'r'}, 'approve': {status: 'accepted', icon: 'done', key: 't'}, 'flag': {status: 'flagged', icon: 'flag', filter: 'Untouched'}, - 'ban': {status: 'banned', icon: ''} + 'ban': {status: 'banned'} }; // Renders a comment list and allow performing actions @@ -40,7 +40,7 @@ export default class CommentList extends React.Component { } } - // Add swipe to approve or reject + // Add swipe to approve or reject or ban bindGestures () { const {actions} = this.props; this._hammer = new Hammer(this.base); @@ -52,6 +52,9 @@ export default class CommentList extends React.Component { if (actions.indexOf('approve') !== -1) { this._hammer.on('swiperight', () => this.props.singleView && this.actionKeyHandler('Approved')); } + if (actions.indexOf('ban') !== -1) { + this._hammer.on('swipeup', () => this.props.singleView && this.actionKeyHandler('Banned')); + } } // Add key handlers. Each action has one and added j/k for moving around diff --git a/client/coral-admin/src/containers/ModerationQueue.js b/client/coral-admin/src/containers/ModerationQueue.js index 1b0b7fb4a..de7708d50 100644 --- a/client/coral-admin/src/containers/ModerationQueue.js +++ b/client/coral-admin/src/containers/ModerationQueue.js @@ -88,7 +88,7 @@ class ModerationQueue extends React.Component { } comments={comments.get('byId')} onClickAction={(action, id) => this.onCommentAction(action, id)} - actions={['reject', 'approve']} + actions={['reject', 'approve', 'ban']} loading={comments.loading} />