From b5a960f7dfd1cc2e94c109e377746a8ac5170701 Mon Sep 17 00:00:00 2001 From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:59:39 +0530 Subject: [PATCH 1/2] investor details --- src/Components/MobileView.jsx | 511 +++++++++++------- .../IO_Management/ViewIO/ViewIOTable.jsx | 93 ++-- src/Routes/Routes.js | 4 +- 3 files changed, 353 insertions(+), 255 deletions(-) diff --git a/src/Components/MobileView.jsx b/src/Components/MobileView.jsx index 8f6dd3c..c6594fa 100644 --- a/src/Components/MobileView.jsx +++ b/src/Components/MobileView.jsx @@ -24,11 +24,11 @@ import { FiInstagram } from "react-icons/fi"; import { IoBatteryHalf } from "react-icons/io5"; import { BiWifi } from "react-icons/bi"; import { useGetIOByIdQuery } from "../Services/io.service"; -import { useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; const MobileView = ({ isOpen, onClose, finalRef }) => { - const [time, setTime] = useState(new Date()); + const navigate = useNavigate(); const params = useParams(); const id = params?.id; @@ -39,8 +39,6 @@ const MobileView = ({ isOpen, onClose, finalRef }) => { } = useGetIOByIdQuery(id, { skip: !id }); console.log(data); - - useEffect(() => { const timer = setInterval(() => { @@ -51,223 +49,332 @@ const MobileView = ({ isOpen, onClose, finalRef }) => { }, []); const formatTime = (date) => { - return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false }); + return date.toLocaleTimeString([], { + hour: "2-digit", + minute: "2-digit", + hour12: false, + }); }; return ( - - - - - - - + + + + - - - - {formatTime(time)} - - {/* */} - - - - - - + - - - Stock - - Closing Date Aug 23 2024 + + + + - + + {formatTime(time)} + + + + + {/* */} - - - Guinevere Gates + + + - - BHD 46,258 + + + + + + + + + + Stock + + + {" "} + + Closing Date Aug 23 2024 + + + + + + + Guinevere Gates + + + BHD 46,258 + + + + 0.0% funded + + + fugit eligendi dolore dolore et + + + + + + Sponsor name: + + + Scott Simon + + + + + Estimated return: + + + A provident veniam + + + + + Hoiding period: + + + Eius eiusmod exericit + + + + + Minimum investment: + + + BHD 1 + + + + + + + Key Merits - - - 0.0% funded - - - fugit eligendi dolore dolore et - - - - - - Sponsor name: - - - 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 + Sit sunt consequunt Dolores minim suscip - - - 0.03 mb - - - - - - Videos - + + + Investment Documents + + + + + + Merrill Rocha + + + + + 0.03 mb + + + + + + + + Videos + + + - - - - + + + - - - - + + + ); }; diff --git a/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx b/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx index a4f164f..f594ebc 100644 --- a/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx +++ b/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx @@ -41,7 +41,7 @@ import { TABLE_PAGINATION } from "../../../Constants/Paginations"; import { formatCurrency } from "../../../Components/CurrencyInput"; import { IoIosPhonePortrait } from "react-icons/io"; import MobileView from "../../../Components/MobileView"; -import { ImMobile2 } from "react-icons/im"; +import { ImMobile } from "react-icons/im"; import { removeTrailingZeros } from "../../../Constants/Constants"; // import { debounce } from "./AddIOCharges"; @@ -60,12 +60,7 @@ const ViewIOTable = () => { const [mouseEntered, setMouseEntered] = useState(false); const [mouseEnteredId, setMouseEnteredId] = useState(""); - const { - isOpen: isOpen, - onOpen: onOpen, - onClose: onClose, - } = useDisclosure(); - + const { isOpen: isOpen, onOpen: onOpen, onClose: onClose } = useDisclosure(); // ===============================[ Paginations ] const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size); @@ -76,7 +71,6 @@ const ViewIOTable = () => { page: currentPage, size: pageSize, }); - // ===============================[ Table Header ] const tableHeadRow = [ @@ -87,7 +81,7 @@ const ViewIOTable = () => { "Goal Amount", "Holding Period", "IO Status", - // "Preview", + "Preview", "Action", ]; @@ -107,7 +101,6 @@ const ViewIOTable = () => { return nameMatches && statusMatches; }); - const extractedArray = filteredData?.map((item, index) => ({ "IO ID": ( @@ -140,9 +133,17 @@ const ViewIOTable = () => { ), "Goal Amount": ( - - - {item.goalAmount ? formatCurrency(removeTrailingZeros(item.goalAmount)) : "---"} + + + {item.goalAmount + ? formatCurrency(removeTrailingZeros(item.goalAmount)) + : "---"} ), @@ -164,7 +165,6 @@ const ViewIOTable = () => { mt={1.5} mb={1.5} textTransform={"none"} - // variant={"solid"} colorScheme={ item?.ioStatus?.statusAdmin === "Draft" @@ -181,32 +181,27 @@ const ViewIOTable = () => { ? "orange" : "purple" } - - boxShadow={'0 4px 6px rgba(0, 0, 0, 0.1)'} // Adjusted shadow + boxShadow={"0 4px 6px rgba(0, 0, 0, 0.1)"} // Adjusted shadow > {item.ioStatus?.statusAdmin} ), - "Preview": ( - + Preview: ( + + // _hover={{ color: "green.500" }} + bg="purple.200" + // transition={"0.5s all"} + onClick={onOpen} + // color="green.300" + rounded={"md"} + size={"xs"} + variant={"ghost"} + > + View + - - - - ), Action: ( @@ -218,19 +213,19 @@ const ViewIOTable = () => { color={"green.500"} placement="top" > */} - + {/* */} {/* { const handleDelete = () => {}; - return ( @@ -369,10 +363,7 @@ const ViewIOTable = () => { setMouseEntered={setMouseEntered} /> - + setDeleteAlert(false)} diff --git a/src/Routes/Routes.js b/src/Routes/Routes.js index d45cb5c..efbba0b 100644 --- a/src/Routes/Routes.js +++ b/src/Routes/Routes.js @@ -62,8 +62,8 @@ export const RouteLink = [ { path: "/view-io/:id", Component: ViewIOdata }, // ===============[ Investor Management]=============== - { path: "/investor-details", Component: InvestorDetails }, - { path: "/investor-details/profile-view/:id", Component: ProfileView }, + { path: "/investor-details", Componinvestorent: InvestorDetails }, + { path: "/investor-details/profile-view/:id", Component: UnderConstruction }, { path: "/investor-details/view-investor-details", Component: ViewInvestorDetails }, // { path: "/investor-transactions", Component: InvestorTransactions }, { path: "/investor-transactions", Component: UnderConstruction }, From 692e08abd6efbc7e27425d7a32d51389341c178c Mon Sep 17 00:00:00 2001 From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:26:25 +0530 Subject: [PATCH 2/2] investor view --- .../Investor_Management/InvestorDetails/InvestorDetails.jsx | 6 +++++- .../Investor_Management/InvestorDetails/ProfileView.jsx | 3 +++ src/Pages/Master/Sponser/Sponsers.jsx | 2 ++ src/Routes/Routes.js | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx b/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx index 790e56e..e785d4e 100644 --- a/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx +++ b/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx @@ -262,6 +262,9 @@ const InvestorDetails = () => { onEditOpen(); }; + console.log(investorDetails?.data?.totalItems); + + return ( @@ -363,12 +366,13 @@ const InvestorDetails = () => { diff --git a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx index a8be18a..bb14246 100644 --- a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx +++ b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx @@ -237,6 +237,7 @@ const ProfileView = () => { View Details { Portfolio { Transaction { console.log(isSponserLoading); + + return ( diff --git a/src/Routes/Routes.js b/src/Routes/Routes.js index efbba0b..d45cb5c 100644 --- a/src/Routes/Routes.js +++ b/src/Routes/Routes.js @@ -62,8 +62,8 @@ export const RouteLink = [ { path: "/view-io/:id", Component: ViewIOdata }, // ===============[ Investor Management]=============== - { path: "/investor-details", Componinvestorent: InvestorDetails }, - { path: "/investor-details/profile-view/:id", Component: UnderConstruction }, + { path: "/investor-details", Component: InvestorDetails }, + { path: "/investor-details/profile-view/:id", Component: ProfileView }, { path: "/investor-details/view-investor-details", Component: ViewInvestorDetails }, // { path: "/investor-transactions", Component: InvestorTransactions }, { path: "/investor-transactions", Component: UnderConstruction },