[ bug fixing done]
This commit is contained in:
@@ -27,7 +27,7 @@ export const conformModalSchema = yup.object().shape({
|
||||
.max(150, "Maximum length should be 150 characters.")
|
||||
// .matches(/^[^\d]+$/, "Sponsor Name cannot contain numbers")
|
||||
.required("Comment is required"),
|
||||
});
|
||||
});
|
||||
|
||||
const RejectReversalPopups = ({
|
||||
isOpen,
|
||||
|
||||
@@ -2,6 +2,7 @@ import {
|
||||
Box,
|
||||
Button,
|
||||
FormControl,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
Input,
|
||||
Modal,
|
||||
@@ -24,8 +25,18 @@ import { useDepositRejectMutation } from "../../../Services/deposit.request.serv
|
||||
import ToastBox from "../../../Components/ToastBox";
|
||||
import { useRejectCommentMutation } from "../../../Services/fawateer.request.service";
|
||||
|
||||
// export const conformModalSchema = yup.object().shape({
|
||||
// comments: yup.string().required("Comment is required")
|
||||
// .max(200, "Approve Comment cannot be more than 200 characters"),
|
||||
// });
|
||||
|
||||
export const conformModalSchema = yup.object().shape({
|
||||
comments: yup.string().required("Comment is required"),
|
||||
// checkerComment: yup.string().required("Comment is required")
|
||||
// .max(50, "Investment name cannot be more than 50 characters"),
|
||||
comments: yup
|
||||
.string()
|
||||
.required("Comment is required")
|
||||
.max(200, "Approve Comment cannot be more than 200 characters"),
|
||||
});
|
||||
|
||||
const RequestRejectModal = ({ isOpen, onClose, firstField ,id}) => {
|
||||
@@ -36,6 +47,7 @@ const RequestRejectModal = ({ isOpen, onClose, firstField ,id}) => {
|
||||
const {
|
||||
register,
|
||||
reset,
|
||||
watch,
|
||||
handleSubmit,
|
||||
formState: { errors },
|
||||
} = useForm({
|
||||
@@ -108,7 +120,7 @@ const RequestRejectModal = ({ isOpen, onClose, firstField ,id}) => {
|
||||
reset()
|
||||
onClose()
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<Modal isCentered isOpen={isOpen} onClose={heandleOnClose} initialFocusRef={firstField}>
|
||||
<ModalOverlay />
|
||||
@@ -133,12 +145,17 @@ const RequestRejectModal = ({ isOpen, onClose, firstField ,id}) => {
|
||||
placeholder={"Enter your comments...."}
|
||||
rounded={"md"}
|
||||
resize={"none"}
|
||||
maxLength={200}
|
||||
/>
|
||||
{errors.comments && (
|
||||
<Text fontSize="xs" color="red">
|
||||
{errors.comments.message}
|
||||
</Text>
|
||||
)}
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
Maximum length should be 200 characters. You have entered
|
||||
<Text as={'span'} ml={2}>{watch("comments")?.length || 0} </Text>characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
|
||||
Reference in New Issue
Block a user