mirror of
https://github.com/wassname/talk.git
synced 2026-07-17 11:33:39 +08:00
Adding the ban action to the moderation queue.
This commit is contained in:
@@ -22,6 +22,7 @@ export default props => (
|
||||
onClick={() => props.onClickAction(props.actionsMap[action].status, props.comment.get('id'))}
|
||||
fab colored>
|
||||
<Icon name={props.actionsMap[action].icon} />
|
||||
<Button>{props.actionsMap[action]}</Button>
|
||||
</Button>
|
||||
) : null)}
|
||||
</div>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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} />
|
||||
</div>
|
||||
<div className={`mdl-tabs__panel ${styles.listContainer}`} id='rejected'>
|
||||
|
||||
Reference in New Issue
Block a user