커스텀알럿 customAlert
import Swal from 'sweetalert2';
export const customConfirm = (
title: string,
text: string,
confirmButton: string,
confirmed: Function
) => {
Swal.fire({
title: title,
text: text,
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: confirmButton,
cancelButtonText: '취소',
}).then((result: any) => {
if (result.isConfirmed) {
confirmed();
}
});
};
export const customAlert = (title: string) => {
Swal.fire({
icon: 'error',
title: title,
confirmButtonColor: '#0c37d6',
});
};
export const customConfirm2 = (title: string) => {
Swal.fire({
icon: 'success',
title: title,
confirmButtonColor: '#08818c',
});
};