You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
import { INFO_ALERT } from "../actions/types"; |
|
import Swal from "sweetalert2"; |
|
|
|
const initialState = {}; |
|
|
|
const modalReducer = (state = initialState, action) => { |
|
const { type, data } = action; |
|
switch (type) { |
|
case INFO_ALERT: |
|
Swal.fire({ |
|
icon: data.icon, |
|
title: data.title, |
|
text: data.text, |
|
input: data.input, |
|
inputPlaceholder: data.inputPlaceholder, |
|
imageUrl: data.imageUrl, |
|
imageAlt: data.imageAlt, |
|
imageWidth: data.imageWidth, |
|
imageHeight: data.imageHeight, |
|
confirmButtonText: data.confirmButtonText, |
|
showCloseButton: data.showCloseButton, |
|
showCancelButton: data.showCancelButton, |
|
cancelButtonText: data.cancelButtonText, |
|
html: data.html, |
|
footer: data.footer, |
|
customClass: { |
|
title: data.customClass.title, |
|
closeButton: data.customClass.closeButton, |
|
confirmButton: data.customClass.confirmButton, |
|
cancelButton: data.customClass.cancelButton, |
|
popup: data.customClass.popup, |
|
input: data.customClass.input, |
|
footer: data.customClass.footer, |
|
}, |
|
}); |
|
return { |
|
...state, |
|
}; |
|
default: |
|
return state; |
|
} |
|
}; |
|
|
|
export default modalReducer;
|
|
|