Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16750 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
16751 stevensc 1
import { actionTypes } from './surveyModal.types'
16750 stevensc 2
 
3
const initialState = {
4
  isOpen: false,
5
  postUrl: ''
6
}
7
 
8
const surveyModalReducer = (state = initialState, { type, payload }) => {
9
  switch (type) {
16751 stevensc 10
    case actionTypes.OPEN_MODAL:
16750 stevensc 11
      return {
12
        ...state,
13
        isOpen: true,
14
        postUrl: payload.postUrl
15
      }
16751 stevensc 16
    case actionTypes.CLOSE_MODAL:
16750 stevensc 17
      return { ...state, isOpen: false }
18
    default:
19
      return state
20
  }
21
}
22
 
23
export default surveyModalReducer