import { WELCOME_POPUP } from 'app/modules/welcomePopUp/store/welcomePopup.constants'; import { WelcomePopupState } from 'app/modules/welcomePopUp/store/welcomePopup.types'; import { AnyAction } from 'redux'; export const defaultWelcomePopupState: WelcomePopupState = { opened: false, }; const welcomePopupReducer = (state = defaultWelcomePopupState, action: AnyAction = { type: '' }) => { switch (action.type) { case WELCOME_POPUP.GET_WELCOME_POPUP_SUCCESS: return { ...state, content: action.payload, opened: false, }; case WELCOME_POPUP.WELCOME_POPUP_SHOW: return { ...state, opened: true, }; case WELCOME_POPUP.WELCOME_POPUP_CLOSE: return { ...state, opened: false, }; default: return state; } }; export { welcomePopupReducer };