mirror of
https://github.com/wassname/talk.git
synced 2026-08-02 13:10:23 +08:00
34 lines
678 B
JavaScript
34 lines
678 B
JavaScript
import {
|
|
SHOW_BAN_USER_DIALOG,
|
|
HIDE_BAN_USER_DIALOG,
|
|
} from '../constants/banUserDialog';
|
|
|
|
const initialState = {
|
|
open: false,
|
|
userId: null,
|
|
username: '',
|
|
commentId: null,
|
|
commentStatus: '',
|
|
};
|
|
|
|
export default function banUserDialog(state = initialState, action) {
|
|
switch (action.type) {
|
|
case SHOW_BAN_USER_DIALOG:
|
|
return {
|
|
...state,
|
|
open: true,
|
|
userId: action.userId,
|
|
username: action.username,
|
|
commentId: action.commentId,
|
|
commentStatus: action.commentStatus,
|
|
};
|
|
case HIDE_BAN_USER_DIALOG:
|
|
return {
|
|
...state,
|
|
open: false,
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
}
|