From 9f54bfbc653753b88f9b423858e67b6f8fcf805b Mon Sep 17 00:00:00 2001 From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:46:10 +0530 Subject: [PATCH] update invest amount --- .../CreateIO/IOTransaction/Pending.jsx | 2 +- .../IOTransaction/ViewAmountInvested.jsx | 150 +++++++----------- .../ViewDistributionInvestor.jsx | 2 - 3 files changed, 62 insertions(+), 92 deletions(-) diff --git a/src/Pages/IO_Management/CreateIO/IOTransaction/Pending.jsx b/src/Pages/IO_Management/CreateIO/IOTransaction/Pending.jsx index cd9a771..1cc5281 100644 --- a/src/Pages/IO_Management/CreateIO/IOTransaction/Pending.jsx +++ b/src/Pages/IO_Management/CreateIO/IOTransaction/Pending.jsx @@ -172,7 +172,7 @@ const Pending = () => { if (item?.transactionType === "Amount Invested") { onInvestmentOpen(); } else if (item?.transactionType === "Distribution To Investor") { - onDistInvestorOpen(); + onInvestmentOpen(); } else if (item?.transactionType === "Exit") { onExitOpen(); } else if (item?.transactionType === "Cancel") { diff --git a/src/Pages/IO_Management/CreateIO/IOTransaction/ViewAmountInvested.jsx b/src/Pages/IO_Management/CreateIO/IOTransaction/ViewAmountInvested.jsx index a34685c..d7a7607 100644 --- a/src/Pages/IO_Management/CreateIO/IOTransaction/ViewAmountInvested.jsx +++ b/src/Pages/IO_Management/CreateIO/IOTransaction/ViewAmountInvested.jsx @@ -114,6 +114,8 @@ const ViewAmountInvested = ({ isOpen, onClose, id:investorId }) => { } }; + const formatDate = (date) => new Date(date).toLocaleDateString(); + const handleAmountChange = (e) => { // e might be an object or just a value, handle both cases const amount = @@ -129,6 +131,7 @@ const ViewAmountInvested = ({ isOpen, onClose, id:investorId }) => { Total_Amount: IODetails?.totalAmtInvestmentInUSD, }); }; + return ( @@ -146,32 +149,9 @@ const ViewAmountInvested = ({ isOpen, onClose, id:investorId }) => { Date - - {errors.transactionDate && ( - - {errors.transactionDate.message} - - )} - - - - - Amount - { fontSize={"sm"} readOnly /> - {errors.Total_Amount && ( - - {errors.Total_Amount.message} - - )} - - Amount to invest - - {/* */} - ( - { - field.onChange(value); // This will keep the form's internal state updated - handleAmountChange(value); // This will trigger your custom logic - }} - /> - )} - /> - {errors.amountInvested && ( - - {errors.amountInvested.message} - - )} - + mb={"15px"} + isInvalid={!!errors.Total_Amount} + isReadOnly +> + + Amount + + + + + + + Amount to invest + + + + + + + IO Cash + + + - - - IO Cash - - - {errors.IoCash && ( - - {errors.IoCash.message} - - )} - diff --git a/src/Pages/IO_Management/CreateIO/IOTransaction/ViewDistributionInvestor.jsx b/src/Pages/IO_Management/CreateIO/IOTransaction/ViewDistributionInvestor.jsx index 591ace7..87b9a25 100644 --- a/src/Pages/IO_Management/CreateIO/IOTransaction/ViewDistributionInvestor.jsx +++ b/src/Pages/IO_Management/CreateIO/IOTransaction/ViewDistributionInvestor.jsx @@ -195,8 +195,6 @@ const ViewDistributionInvestor = ({ isOpen, onClose,id:exitId }) => { setIsFinalCalculateLoading(false); setIsCalcualtedData(false); }; - - console.log(exitId); return ( -- 2.34.1