diff --git a/src/components/Swal/CustomAlerts.js b/src/components/Swal/CustomAlerts.js index ea96112..08ef943 100644 --- a/src/components/Swal/CustomAlerts.js +++ b/src/components/Swal/CustomAlerts.js @@ -1,5 +1,5 @@ import Swal from "sweetalert2"; -import "./sweetalert2.css" +import "./sweetalert2.css"; export const msg = (text) => { Swal.mixin({ @@ -28,8 +28,8 @@ export const successDialog = (text, t) => { title: text, confirmButtonText: t("Confirm"), showConfirmButton: true, - }) -} + }); +}; export const successDialogWithContent = (title, text, t) => { return Swal.fire({ @@ -38,8 +38,8 @@ export const successDialogWithContent = (title, text, t) => { html: text, confirmButtonText: t("Confirm"), showConfirmButton: true, - }) -} + }); +}; export const errorDialog = (text, t) => { return Swal.fire({ @@ -47,18 +47,18 @@ export const errorDialog = (text, t) => { title: text, confirmButtonText: t("Confirm"), showConfirmButton: true, - }) -} + }); +}; -export const errorDialogWithContent = (title, text, t) => { +export const errorDialogWithContent = (title, text, t) => { return Swal.fire({ icon: "error", title: title, html: text, confirmButtonText: t("Confirm"), showConfirmButton: true, - }) -} + }); +}; export const warningDialog = (text, t) => { return Swal.fire({ @@ -66,13 +66,17 @@ export const warningDialog = (text, t) => { title: text, confirmButtonText: t("Confirm"), showConfirmButton: true, - }) -} + }); +}; -export const submitDialog = async (confirmAction, t, {...props} = { - title: t("Do you want to submit?"), - confirmButtonText: t("Submit"), -}) => { +export const submitDialog = async ( + confirmAction, + t, + { ...props } = { + title: t("Do you want to submit?"), + confirmButtonText: t("Submit"), + } +) => { // console.log(props) // const { t } = useTranslation("common") const result = await Swal.fire({ @@ -90,13 +94,17 @@ export const submitDialog = async (confirmAction, t, {...props} = { if (result.isConfirmed) { confirmAction(); } -} +}; -export const submitDialogWithWarning = async (confirmAction, t, {...props} = { - title: t("Do you want to submit?"), - text: t("Warning!"), - confirmButtonText: t("Submit"), -}) => { +export const submitDialogWithWarning = async ( + confirmAction, + t, + { ...props } = { + title: t("Do you want to submit?"), + text: t("Warning!"), + confirmButtonText: t("Submit"), + } +) => { // console.log(props) // const { t } = useTranslation("common") const result = await Swal.fire({ @@ -115,7 +123,7 @@ export const submitDialogWithWarning = async (confirmAction, t, {...props} = { if (result.isConfirmed) { confirmAction(); } -} +}; export const deleteDialog = async (confirmAction, t) => { // const { t } = useTranslation("common") @@ -134,4 +142,4 @@ export const deleteDialog = async (confirmAction, t) => { if (result.isConfirmed) { confirmAction(); } -} \ No newline at end of file +}; diff --git a/src/components/Swal/sweetalert2.css b/src/components/Swal/sweetalert2.css index 4825796..ac7225f 100644 --- a/src/components/Swal/sweetalert2.css +++ b/src/components/Swal/sweetalert2.css @@ -1,7 +1,7 @@ .swal-container-class { - z-index: 9999; /* Adjust the z-index value as needed */ - } - + z-index: 9999; /* Adjust the z-index value as needed */ +} + .swal-popup-class { -z-index: 10000; /* Adjust the z-index value as needed */ -} \ No newline at end of file + z-index: 10000; /* Adjust the z-index value as needed */ +}