File size: 402 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const initialState = {
  modalType: null,
  modalProps: {},
  isOpen: false,
};

export default function modal(state = initialState, action) {
  switch (action.type) {
    case 'SHOW_MODAL':
      return {
        modalType: action.modalType,
        modalProps: action.modalProps,
        isOpen: true,
      };
    case 'HIDE_MODAL':
      return initialState;
    default:
      return state;
  }
}