|
|
|
@ -16,11 +16,11 @@ export const ModalProvider = ({ children = [], reducer = modalReducer, initialSt |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const modal = (modalData: AppModal) => { |
|
|
|
|
const { id, title, message, okLabel, okFn, cancelLabel, cancelFn, modalType, defaultValue, hideFn, data } = modalData |
|
|
|
|
const { id, title, message, validationFn, okLabel, okFn, cancelLabel, cancelFn, modalType, defaultValue, hideFn, data } = modalData |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
dispatch({ |
|
|
|
|
type: modalActionTypes.setModal, |
|
|
|
|
payload: { id, title, message, okLabel, okFn, cancelLabel, cancelFn, modalType: modalType || ModalTypes.default, defaultValue: defaultValue, hideFn, resolve, next: onNextFn, data } |
|
|
|
|
payload: { id, title, message, okLabel, validationFn, okFn, cancelLabel, cancelFn, modalType: modalType || ModalTypes.default, defaultValue: defaultValue, hideFn, resolve, next: onNextFn, data } |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -32,7 +32,7 @@ export const ModalProvider = ({ children = [], reducer = modalReducer, initialSt |
|
|
|
|
const handleHideModal = () => { |
|
|
|
|
dispatch({ |
|
|
|
|
type: modalActionTypes.handleHideModal, |
|
|
|
|
payload: null |
|
|
|
|
payload: null, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|