From f3b81904186ab0de341337e82c846eac8f876a23 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Wed, 10 Jul 2024 18:42:33 +0100 Subject: [PATCH] offer interest page update --- .../OffersInterest/ManageInterestOffer.jsx | 51 ++++++++++++++++--- .../OffersInterest/OffersInterestTable.jsx | 16 +++++- .../OffersInterest/OthersInterestedTable.jsx | 17 ++++++- 3 files changed, 73 insertions(+), 11 deletions(-) diff --git a/src/components/OffersInterest/ManageInterestOffer.jsx b/src/components/OffersInterest/ManageInterestOffer.jsx index 375af91..b18a593 100644 --- a/src/components/OffersInterest/ManageInterestOffer.jsx +++ b/src/components/OffersInterest/ManageInterestOffer.jsx @@ -6,10 +6,18 @@ import CommonHead from "../UserHeader/CommonHead"; import usersService from "../../services/UsersService"; import LoadingSpinner from "../Spinners/LoadingSpinner"; import OthersInterestedTable from "./OthersInterestedTable"; -import { useDispatch } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import { tableReload } from "../../store/TableReloads"; +import { PriceFormatter } from "../Helpers/PriceFormatter"; export default function ManageInterestOffer(props) { + + const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE + + let walletBal = walletDetails?.data?.filter(wallet => wallet.code == props?.offerDetails?.currency_code) // USER WALLET BALANCE FOR CORRESPONDING TASK CURRENCY + + let clientAdded = new Date(props.offerDetails?.client_added) + const dispatch = useDispatch() const navigate = useNavigate() const apiCall = new usersService() @@ -183,12 +191,21 @@ export default function ManageInterestOffer(props) { + {/* END OF switch button */} @@ -202,7 +219,10 @@ export default function ManageInterestOffer(props) {
Member Since - {props.offerDetails?.client_added} + + {clientAdded.getFullYear()}{" - "} + {clientAdded.getMonth() < 9 ? '0'+ (clientAdded.getMonth() + 1) : clientAdded.getMonth() + 1} +
@@ -230,7 +250,7 @@ export default function ManageInterestOffer(props) {
- : + : tab == 'message' ?

To: {props.offerDetails?.client_name}

@@ -294,14 +314,31 @@ export default function ManageInterestOffer(props) { }
+ : tab == 'details' ? +
+

{props?.offerDetails?.description}

+
+ : + null } {/* END OF Detail section */} - {/* BUTTON section */}
-
+ {/* Wallet balance and reward */} +
+
+

Wallet:

+ {PriceFormatter(walletBal[0]?.amount * 0.01,props?.offerDetails?.currency_code,props?.offerDetails?.currency)} +
+
+

Reward:

+ {PriceFormatter(props?.offerDetails?.price * 0.01,props?.offerDetails?.currency_code,props?.offerDetails?.currency)} +
+
+ {/* BUTTON section */} +
{requestStatus.loading && requestStatus.processType == 'accept' ? @@ -333,6 +370,7 @@ export default function ManageInterestOffer(props) { }
+ {/* END of BUTTON section */} {/* ERROR DISPLAY */}
@@ -357,7 +395,6 @@ export default function ManageInterestOffer(props) { {/* End of error or success display */}
- {/* END of BUTTON section */}
{/* END OF manage offer section */} diff --git a/src/components/OffersInterest/OffersInterestTable.jsx b/src/components/OffersInterest/OffersInterestTable.jsx index 649dcf4..b87342a 100644 --- a/src/components/OffersInterest/OffersInterestTable.jsx +++ b/src/components/OffersInterest/OffersInterestTable.jsx @@ -100,9 +100,21 @@ export default function OffersInterestTable({offerInterestList, className}) { }); }} type="button" - className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white" + className='w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white' > - View + + + diff --git a/src/components/OffersInterest/OthersInterestedTable.jsx b/src/components/OffersInterest/OthersInterestedTable.jsx index aa2ced7..dcc0e2a 100644 --- a/src/components/OffersInterest/OthersInterestedTable.jsx +++ b/src/components/OffersInterest/OthersInterestedTable.jsx @@ -101,9 +101,22 @@ export default function OthersInterestTable({othersInterestedList, className}) { }); }} type="button" - className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white" + className="w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white" > - View + {/* View */} + + + -- 2.34.1