[ Bug Fixing 👍 ]
This commit is contained in:
@@ -29,7 +29,7 @@ export const conformModalSchema = yup.object().shape({
|
||||
.string()
|
||||
.min(2, "Minimum length should be 150 characters.")
|
||||
.max(150, "Maximum length should be 150 characters.")
|
||||
.matches(/^[^\d]+$/, "Sponsor Name cannot contain numbers")
|
||||
// .matches(/^[^\d]+$/, "Sponsor Name cannot contain numbers")
|
||||
.required("Comment is required"),
|
||||
subject: yup.string().notRequired(),
|
||||
emailTemplate: yup.string().notRequired(),
|
||||
@@ -59,6 +59,13 @@ const ConfirmReversalPopups = ({
|
||||
setValue("emailTemplate", richTextValue);
|
||||
}, [richTextValue]);
|
||||
|
||||
// Reset the form when the modal closes
|
||||
useEffect(() => {
|
||||
if (!isOpen) {
|
||||
reset(); // Clear the form state
|
||||
}
|
||||
}, [isOpen, reset]);
|
||||
|
||||
const [emailApproval, setEmailApproval] = useBoolean(false);
|
||||
|
||||
const modules = {
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
Text,
|
||||
Textarea,
|
||||
} from "@chakra-ui/react";
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import * as yup from "yup";
|
||||
@@ -25,7 +25,7 @@ export const conformModalSchema = yup.object().shape({
|
||||
.string()
|
||||
.min(2, "Minimum length should be 150 characters.")
|
||||
.max(150, "Maximum length should be 150 characters.")
|
||||
.matches(/^[^\d]+$/, "Sponsor Name cannot contain numbers")
|
||||
// .matches(/^[^\d]+$/, "Sponsor Name cannot contain numbers")
|
||||
.required("Comment is required"),
|
||||
});
|
||||
|
||||
@@ -46,6 +46,13 @@ const InitiateReversalPopup = ({
|
||||
mode: "all",
|
||||
});
|
||||
|
||||
// Reset the form when the modal closes
|
||||
useEffect(() => {
|
||||
if (!isOpen) {
|
||||
reset(); // Clear the form state
|
||||
}
|
||||
}, [isOpen, reset]);
|
||||
|
||||
return (
|
||||
<Modal isOpen={isOpen} onClose={onClose}>
|
||||
<ModalOverlay />
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
Text,
|
||||
Textarea,
|
||||
} from "@chakra-ui/react";
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import * as yup from "yup";
|
||||
@@ -25,7 +25,7 @@ export const conformModalSchema = yup.object().shape({
|
||||
.string()
|
||||
.min(2, "Minimum length should be 150 characters.")
|
||||
.max(150, "Maximum length should be 150 characters.")
|
||||
.matches(/^[^\d]+$/, "Sponsor Name cannot contain numbers")
|
||||
// .matches(/^[^\d]+$/, "Sponsor Name cannot contain numbers")
|
||||
.required("Comment is required"),
|
||||
});
|
||||
|
||||
@@ -46,6 +46,13 @@ const RejectReversalPopups = ({
|
||||
mode: "all",
|
||||
});
|
||||
|
||||
// Reset the form when the modal closes
|
||||
useEffect(() => {
|
||||
if (!isOpen) {
|
||||
reset(); // Clear the form state
|
||||
}
|
||||
}, [isOpen, reset]);
|
||||
|
||||
return (
|
||||
<Modal isOpen={isOpen} onClose={onClose}>
|
||||
<ModalOverlay />
|
||||
|
||||
@@ -302,7 +302,7 @@ const DashboardLayout = ({ isOnline }) => {
|
||||
return (
|
||||
<span className="d-flex align-items-end gap-2">
|
||||
<RiBankLine className="h4 m-0 fw-normal" />
|
||||
Bank Deposit Request
|
||||
Reversal Transaction / Deposit Request
|
||||
</span>
|
||||
);
|
||||
case path.startsWith("/reversal-fawateer-deposit"):
|
||||
@@ -733,6 +733,7 @@ const DashboardLayout = ({ isOnline }) => {
|
||||
} else if (type === "single") {
|
||||
return (
|
||||
<Tooltip
|
||||
isDisabled={isDrawerOpen || openDrawerClick}
|
||||
hasArrow
|
||||
bg={"#fff"}
|
||||
fontSize={"xs"}
|
||||
|
||||
@@ -104,6 +104,12 @@ const RequestApproveModal = ({ isOpen, onClose, firstField ,id}) => {
|
||||
}
|
||||
}, [data, reset]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) {
|
||||
reset();
|
||||
}
|
||||
}, [isOpen, reset]);
|
||||
|
||||
const heandleOnClose = () =>{
|
||||
reset()
|
||||
onClose()
|
||||
@@ -130,7 +136,7 @@ const RequestApproveModal = ({ isOpen, onClose, firstField ,id}) => {
|
||||
fontSize="sm"
|
||||
type="textarea"
|
||||
size="md"
|
||||
placeholder={"Enter your checkerComment...."}
|
||||
placeholder={"Enter your checker Comment...."}
|
||||
rounded={"md"}
|
||||
resize={"none"}
|
||||
maxLength={200}
|
||||
|
||||
@@ -42,6 +42,13 @@ const RequestRejectModal = ({ isOpen, onClose, firstField ,id}) => {
|
||||
resolver: yupResolver(conformModalSchema),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) {
|
||||
reset(); // Clear the form state
|
||||
}
|
||||
}, [isOpen, reset]);
|
||||
|
||||
|
||||
const [ rejectFawateer ] = useRejectCommentMutation()
|
||||
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ export const nav = [
|
||||
title: "Fawateer Deposit",
|
||||
submenu: [
|
||||
{
|
||||
title: "Aprover Request",
|
||||
title: "Approver Request",
|
||||
path: "/fawateer",
|
||||
icon: RiMoneyDollarBoxLine,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user