(feat) add handle close custom from handle payment status modal when close navigate to /profile

This commit is contained in:
ALi Josheghani
2024-10-01 00:12:03 +03:30
parent b21d8f7e86
commit e26282c825

View File

@@ -1,6 +1,7 @@
import { Dispatch, SetStateAction } from "react"; import { Dispatch, SetStateAction } from "react";
import MuiModal from "../../../../common/modal"; import MuiModal from "../../../../common/modal";
import { MdError, MdVerified } from "react-icons/md"; import { MdError, MdVerified } from "react-icons/md";
import { useNavigate } from "react-router-dom";
const ModalPayment = ({ const ModalPayment = ({
isOpen, isOpen,
@@ -14,9 +15,19 @@ const ModalPayment = ({
message: string; message: string;
}) => { }) => {
console.log(isPayment); console.log(isPayment);
const navigate = useNavigate();
const handleCloseCustom = () => {
setIsOpen(false);
navigate("/profile");
};
return ( return (
<MuiModal isOpenModal={isOpen} setIsOpenModal={setIsOpen} title="وضعیت"> <MuiModal
isOpenModal={isOpen}
setIsOpenModal={setIsOpen}
handleCloseCustom={handleCloseCustom}
title="وضعیت"
>
<div className="relative w-full h-full px-4 py-2"> <div className="relative w-full h-full px-4 py-2">
<div className="w-full h-full flex flex-col gap-4 justify-center items-center"> <div className="w-full h-full flex flex-col gap-4 justify-center items-center">
{isPayment ? ( {isPayment ? (