From 3f43bf9f4ac4186a1668b57811a0344315467cf1 Mon Sep 17 00:00:00 2001 From: Amin Ghasempoor Date: Sat, 22 Jul 2023 15:26:57 +0330 Subject: [PATCH] warning notification --- .../notifications/WarningNotification.jsx | 41 +++++++++++++++++++ src/core/components/notifications/index.jsx | 1 + 2 files changed, 42 insertions(+) create mode 100644 src/core/components/notifications/WarningNotification.jsx diff --git a/src/core/components/notifications/WarningNotification.jsx b/src/core/components/notifications/WarningNotification.jsx new file mode 100644 index 0000000..1451031 --- /dev/null +++ b/src/core/components/notifications/WarningNotification.jsx @@ -0,0 +1,41 @@ +import ReportIcon from "@mui/icons-material/Report"; +import { Box, Divider, Typography } from "@mui/material"; +import { toast } from "react-toastify"; + +const WarningNotification = (directionApp, t, status) => { + toast( + ({ closeToast }) => ( + <> + + + + + + {t("warning")} ({t("code")}: {status}) + + + {t("warning_static_text")} + + + + + + + ), + { + position: directionApp === "ltr" ? "top-left" : "top-right", + autoClose: false, + closeOnClick: false, + draggable: false, + } + ); +}; + +export default WarningNotification; diff --git a/src/core/components/notifications/index.jsx b/src/core/components/notifications/index.jsx index f9eb82c..ddef384 100644 --- a/src/core/components/notifications/index.jsx +++ b/src/core/components/notifications/index.jsx @@ -1,4 +1,5 @@ import ErrorNotification from "./ErrorNotification"; +import WarningNotification from "./WarningNotification"; import SuccessNotification from "./successNotification"; const Notifications = async (directionApp, response, t) => {