[ deletion request modal bugs ]

This commit is contained in:
YasinShaikh123
2025-01-20 19:35:58 +05:30
parent 066e2fc169
commit 41a1bde62b
2 changed files with 19 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ import {
Box,
Button,
FormControl,
FormHelperText,
FormLabel,
Input,
Modal,
@@ -29,8 +30,17 @@ import { useApproveDepositRequestMutation, useGetDeleteRequestByIdQuery } from "
const FILE_TYPES = ["image/jpeg", "image/png", "image/gif"];
// export const conformModalSchema = yup.object().shape({
// adminComment: yup.string().notRequired(),
// });
export const conformModalSchema = yup.object().shape({
adminComment: yup.string().notRequired(),
// checkerComment: yup.string().required("Comment is required")
// .max(50, "Investment name cannot be more than 50 characters"),
adminComment: yup
.string()
.required("Comment is required")
.max(200, "Approve Comment cannot be more than 200 characters"),
});
const DeletionRequestApprove = ({ isOpen, onClose, firstField, id, data:requestData }) => {
@@ -50,6 +60,7 @@ const DeletionRequestApprove = ({ isOpen, onClose, firstField, id, data:requestD
const {
register,
reset,
watch,
handleSubmit,
formState: { errors },
} = useForm({
@@ -171,6 +182,10 @@ const DeletionRequestApprove = ({ isOpen, onClose, firstField, id, data:requestD
{errors.adminComment.message}
</Text>
)}
<FormHelperText fontSize="xs" color="gray.500">
<Text as={'span'} me={2}> Maximum length should be 200 characters. You have entered</Text>
{watch("adminComment")?.length || 0} characters.
</FormHelperText>
</FormControl>
</ModalBody>
<ModalFooter>
@@ -180,9 +195,10 @@ const DeletionRequestApprove = ({ isOpen, onClose, firstField, id, data:requestD
type="submit"
size={"sm"}
rounded={"sm"}
variant={'ghost'}
bg="gray"
onClick={()=> setIsReject(true)}
isLoading={isBtnLoadingReject}
fontWeight={500}
>
Reject
</Button>

View File

@@ -140,7 +140,7 @@ const RequestApproveModal = ({ isOpen, onClose, firstField ,id}) => {
rounded={"md"}
resize={"none"}
maxLength={200}
/>
/>
{errors.checkerComment && (
<Text fontSize="xs" color="red">
{errors.checkerComment.message}