Progress
This commit is contained in:
@@ -1,17 +1,24 @@
|
||||
import { MODAL_OPEN, MODAL_CLOSE } from '../actions/modal';
|
||||
import Immutable from 'immutable'
|
||||
import {
|
||||
MODAL_OPEN,
|
||||
MODAL_CLOSE,
|
||||
} from '../actions/modal'
|
||||
|
||||
const initialState = {
|
||||
const initialState = Immutable.Map({
|
||||
modalType: null,
|
||||
modalProps: {},
|
||||
};
|
||||
modalProps: null,
|
||||
})
|
||||
|
||||
export default function modal(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case MODAL_OPEN:
|
||||
return { modalType: action.modalType, modalProps: action.modalProps };
|
||||
return state.withMutations(map => {
|
||||
map.set('modalType', action.modalType)
|
||||
map.set('modalProps', action.modalProps)
|
||||
})
|
||||
case MODAL_CLOSE:
|
||||
return initialState;
|
||||
return initialState
|
||||
default:
|
||||
return state;
|
||||
return state
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user