person
@@ -19,10 +19,9 @@ export default props => (
{props.actions.map(action => canShowAction(action, props.comment) ? (
) : null)}
diff --git a/client/coral-admin/src/components/CommentList.js b/client/coral-admin/src/components/CommentList.js
index 3e4ae45cd..e015c54d3 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'}
+ 'ban': {status: 'banned', icon: 'not interested', text: 'Ban User'}
};
// Renders a comment list and allow performing actions
diff --git a/client/coral-admin/src/reducers/users.js b/client/coral-admin/src/reducers/users.js
new file mode 100644
index 000000000..68c094816
--- /dev/null
+++ b/client/coral-admin/src/reducers/users.js
@@ -0,0 +1,23 @@
+
+import {Map, List, fromJS} from 'immutable';
+
+const initialState = Map({
+ byId: Map(),
+ ids: List(),
+ loading: false
+});
+
+// Handle the users actions
+export default (state = initialState, action) => {
+ switch (action.type) {
+ case 'USER_STATUS_UPDATE': return updateUserStatus(state, action);
+ default: return state;
+ }
+};
+
+// Update a user status
+const updateUserStatus = (state, action) => {
+ const byId = state.get('byId');
+ const data = byId.get(action.id).set('status', action.status.toLowerCase());
+ return state.set('byId', byId.set(action.id, data));
+};