From 4a3072b4d37bd2210c67011809de8c2294ea4f31 Mon Sep 17 00:00:00 2001 From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:00:22 +0530 Subject: [PATCH] io mobile --- src/Components/MobileView.jsx | 571 ++++++++++-------- src/Constants/Constants.js | 7 + .../IO_Management/CreateIO/KeyMerits.jsx | 3 +- .../IO_Management/ViewIO/ViewIOTable.jsx | 9 +- src/Pages/IO_Management/ViewIO/ViewIOdata.jsx | 2 +- .../InvestorDetails/ProfileView.jsx | 4 +- 6 files changed, 328 insertions(+), 268 deletions(-) diff --git a/src/Components/MobileView.jsx b/src/Components/MobileView.jsx index c6594fa..ca8438f 100644 --- a/src/Components/MobileView.jsx +++ b/src/Components/MobileView.jsx @@ -25,20 +25,26 @@ import { IoBatteryHalf } from "react-icons/io5"; import { BiWifi } from "react-icons/bi"; import { useGetIOByIdQuery } from "../Services/io.service"; import { useNavigate, useParams } from "react-router-dom"; +import FullscreenLoaders from "./Loaders/FullscreenLoaders"; +import { formatDate } from "../Constants/Constants"; +import { BsFileText } from "react-icons/bs"; -const MobileView = ({ isOpen, onClose, finalRef }) => { +const MobileView = ({ isOpen, onClose, finalRef, actionId }) => { const [time, setTime] = useState(new Date()); const navigate = useNavigate(); const params = useParams(); - const id = params?.id; + const id = actionId; const { - data, + data: IObyID, isLoading: IObyIDisLoading, error: IObyIDerror, } = useGetIOByIdQuery(id, { skip: !id }); - console.log(data); + console.log(IObyID); + + const keyMerits = IObyID?.data?.keyMerits || []; + const artifactsImage = IObyID?.data?.artifactsImage || []; useEffect(() => { const timer = setInterval(() => { @@ -98,278 +104,321 @@ const MobileView = ({ isOpen, onClose, finalRef }) => { pt={"36px"} px={"15px"} > - - - - - - - {formatTime(time)} - - - - - {/* */} - - - - - - - - - - - - - - - Stock - - + ) : ( + <> + + - {" "} - - Closing Date Aug 23 2024 + + - - - - - - Guinevere Gates - - - BHD 46,258 - - - - 0.0% funded - - - fugit eligendi dolore dolore et - - - - - - Sponsor name: + + {formatTime(time)} - - Scott Simon - - - - - Estimated return: - - - A provident veniam - - - - - Hoiding period: - - - Eius eiusmod exericit - - - - - Minimum investment: - - - BHD 1 - - - - - - - Key Merits - - - - - Sit sunt consequunt Dolores minim suscip - - - - - - Investment Documents - - - - - - Merrill Rocha + + + {/* */} - - 0.03 mb + + + + + - - - - - Videos - - - - + + + + + Stock + + + {" "} + + Closing Date {formatDate(IObyID?.data?.closingDate)} + + + {artifactsImage?.[0]?.artifactPathName && ( + + )} + + + + {IObyID?.data?.investmentType?.investmentTypeName} + + + BHD {IObyID?.data?.goalAmount} + + + + 0.0% funded + + + {IObyID?.data?.descriptionEnglish} + + + + + + Sponsor name: + + + {IObyID?.data?.sponsor?.sponsorName} + + + + + Estimated return: + + + {IObyID?.data?.expectedReturn} + + + + + Hoiding period: + + + {IObyID?.data?.holdingPeriod} + + + + + Minimum investment: + + + { + IObyID?.data?.minInvestmentAmt?.[0]?.country + ?.minInvestmentAmt + } + + + + + + + Key Merits + + + {keyMerits?.[0]?.icon?.iconFilePath && ( + + )} + + {IObyID?.data?.keyMerits[0]?.meritsDescription} + + + + + + Investment Documents + + + + {/* */} + + + {IObyID?.data?.documents?.[0]?.documentName} + + + + + {IObyID?.data?.documents?.[0]?.documentSize} + + + + + + + + Videos + + + + - - - + + + + + )} diff --git a/src/Constants/Constants.js b/src/Constants/Constants.js index 8a5decd..ab8c7a7 100644 --- a/src/Constants/Constants.js +++ b/src/Constants/Constants.js @@ -130,3 +130,10 @@ export function formatTimestampInGulfTimezone(timestamp) { }; return date.toLocaleDateString('en-GB', options); } + + +export function formatDate(dateString) { + const options = { year: 'numeric', month: 'short', day: 'numeric' }; + const date = new Date(dateString); + return date.toLocaleDateString('en-US', options); +} \ No newline at end of file diff --git a/src/Pages/IO_Management/CreateIO/KeyMerits.jsx b/src/Pages/IO_Management/CreateIO/KeyMerits.jsx index 38defd1..1df3469 100644 --- a/src/Pages/IO_Management/CreateIO/KeyMerits.jsx +++ b/src/Pages/IO_Management/CreateIO/KeyMerits.jsx @@ -57,6 +57,7 @@ const KeyMerits = ({ enableNextTab, index, data: prepopData }) => { const [isBtnLoading, setIsBtnLoading] = useState(false); const [mouseEnteredId, setMouseEnteredId] = useState(""); const { isOpen, onOpen, onClose } = useDisclosure(); + const { isOpen: isEditOpen, onOpen: onEditOpen, @@ -128,7 +129,7 @@ const KeyMerits = ({ enableNextTab, index, data: prepopData }) => { ), Icon: item?.icon?.iconFilePath && ( - { // ===============================[ RTK Api calls ] const { data, isLoading, error } = useGetIOsQuery({ - page: currentPage, + page: currentPage, size: pageSize, }); @@ -193,7 +193,10 @@ const ViewIOTable = () => { // _hover={{ color: "green.500" }} bg="purple.200" // transition={"0.5s all"} - onClick={onOpen} + onClick={() =>{ + setActionId(item.id) + onOpen(); + }} // color="green.300" rounded={"md"} size={"xs"} @@ -363,7 +366,7 @@ const ViewIOTable = () => { setMouseEntered={setMouseEntered} /> - + setDeleteAlert(false)} diff --git a/src/Pages/IO_Management/ViewIO/ViewIOdata.jsx b/src/Pages/IO_Management/ViewIO/ViewIOdata.jsx index c36604d..8c71750 100644 --- a/src/Pages/IO_Management/ViewIO/ViewIOdata.jsx +++ b/src/Pages/IO_Management/ViewIO/ViewIOdata.jsx @@ -39,7 +39,7 @@ import UnderConstruction from "../../UnderConstruction"; const ViewIOdata = () => { - const params = useParams() + const params = useParams() const id = params?.id const { data, error, isLoading } = useGetIOprepopulateDataQuery(); const { isOpen, onOpen, onClose } = useDisclosure(); diff --git a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx index bb14246..08f3c9c 100644 --- a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx +++ b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx @@ -174,7 +174,7 @@ const ProfileView = () => { as="span" boxShadow={"lg"} rounded={"md"} - bg={"#EAF2EC"} + bg={"#EAF2EC"} > @@ -257,7 +257,7 @@ const ProfileView = () => { Transaction