diff --git a/src/Pages/Fawateer/CreateRequest.jsx b/src/Pages/Fawateer/CreateRequest.jsx index e04dc26..fd2bda8 100644 --- a/src/Pages/Fawateer/CreateRequest.jsx +++ b/src/Pages/Fawateer/CreateRequest.jsx @@ -8,7 +8,7 @@ import { } from "@chakra-ui/react"; import { DeleteIcon, Search2Icon } from "@chakra-ui/icons"; import SelectInvestorModal from "./SelectInvestorModal"; -import { useForm } from "react-hook-form"; // Import useForm +import { Controller, useForm } from "react-hook-form"; // Import useForm import { yupResolver } from "@hookform/resolvers/yup"; // Import resolver for Yup import * as Yup from "yup"; // Import Yup for validation import { motion } from 'framer-motion'; // Import Framer Motion for animations @@ -16,6 +16,7 @@ import { bytesToMB } from "../../Constants/Constants"; import { useCreateFawateerRequestMutation } from "../../Services/fawateer.maker.service"; import ToastBox from "../../Components/ToastBox"; import { useNavigate } from "react-router-dom"; +import CurrencyInput from "../../Components/CurrencyInput"; // Validation schema using Yup const validationSchema = Yup.object().shape({ @@ -47,7 +48,7 @@ const CreateRequest = () => { const [id, setId ] = useState(null) // Initialize useForm with the resolver for Yup validation - const { register, handleSubmit, setValue,reset, formState: { errors } } = useForm({ + const {control, register, handleSubmit, setValue,reset, formState: { errors } } = useForm({ resolver: yupResolver(validationSchema), }); @@ -217,17 +218,16 @@ const CreateRequest = () => { Amount (BHD) - - {errors.transaction_amount?.message} + ( + + )} + /> + + {errors.transaction_amount?.message} + {/* Support File Field with Preview */} diff --git a/src/Pages/IO_Management/CreateIO/AddIONav.jsx b/src/Pages/IO_Management/CreateIO/AddIONav.jsx index 84d91c0..d236ab1 100644 --- a/src/Pages/IO_Management/CreateIO/AddIONav.jsx +++ b/src/Pages/IO_Management/CreateIO/AddIONav.jsx @@ -190,10 +190,12 @@ console.log(calculatePercentage(1092500, 976070)); Current nav - {parseFloat(IODetails?.ioNAV || 0).toLocaleString(undefined, { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - })} + + {parseFloat(IODetails?.ioNAV || 0).toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} +