From 4b2b6aa2d9f83a958af1525d8639f066e116e095 Mon Sep 17 00:00:00 2001 From: ALi Josheghani Date: Mon, 16 Sep 2024 12:42:34 +0330 Subject: [PATCH] Refactor: Update Layout component to display a toast notification for network maintenance --- src/layout/index.tsx | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/layout/index.tsx b/src/layout/index.tsx index 41b687a..612c9c4 100644 --- a/src/layout/index.tsx +++ b/src/layout/index.tsx @@ -6,6 +6,7 @@ import { Helmet } from "react-helmet-async"; import { useEffect } from "react"; import { useDispatch } from "react-redux"; import { setConfigId } from "../redux/slices/configId"; +import toast from "react-hot-toast"; const Layout = () => { const { configs } = useParams<{ configs: string }>(); @@ -23,8 +24,48 @@ const Layout = () => { console.error("Element with ID 'configs' not found"); } }, 100); // Scroll to 100% of the page height - }, [configs,dispatch]); + }, [configs, dispatch]); + useEffect(() => { + toast.custom( + (t) => ( +
+
+ کاربر عزیز درودبه اطلاع می‌رسانیم به علت عملیات توسعه و نگهداری شبکه + شاپرک از ساعت ۲۳ روز ۲۵ شهریور الی ۶ بامداد مورخ ۲۶ شهریور احتمال + اختلال و قطعی در درگاه پرداخت اینترنتی وجود دارد. خواهشمندیم عملیات + پرداخت را قبل و یا بعد از این زمان انجام دهید یا با مراجعه به + پشتیبانی تلگرام به نشانی{" "} + + PersianPingSupport + {" "} + از طریق کارت به کارت سرویس خود را خریداری کنید +
+ +
+ ), + { position: "bottom-center", duration: Infinity } + ); + }, []); return ( <>