2024-07-08 20:14:34 +05:30
|
|
|
import {
|
|
|
|
|
Button,
|
|
|
|
|
Divider,
|
|
|
|
|
Image,
|
|
|
|
|
Menu,
|
|
|
|
|
MenuButton,
|
|
|
|
|
MenuItem,
|
|
|
|
|
MenuList,
|
|
|
|
|
Modal,
|
|
|
|
|
ModalBody,
|
|
|
|
|
ModalCloseButton,
|
|
|
|
|
ModalContent,
|
|
|
|
|
ModalFooter,
|
|
|
|
|
ModalHeader,
|
|
|
|
|
ModalOverlay,
|
|
|
|
|
Portal,
|
|
|
|
|
Text,
|
|
|
|
|
useDisclosure,
|
2024-07-09 13:05:58 +05:30
|
|
|
MenuItemOption,
|
|
|
|
|
MenuGroup,
|
|
|
|
|
MenuOptionGroup,
|
2024-07-09 19:05:08 +05:30
|
|
|
MenuDivider,
|
|
|
|
|
Badge,
|
|
|
|
|
Box,
|
2024-07-15 12:27:23 +05:30
|
|
|
Icon,
|
2024-07-09 12:25:52 +05:30
|
|
|
} from "@chakra-ui/react";
|
2024-07-05 20:02:10 +05:30
|
|
|
import header from "../../../assets/IOheader.png";
|
2024-07-08 20:14:34 +05:30
|
|
|
import { HiDotsVertical } from "react-icons/hi";
|
2024-07-10 12:02:35 +05:30
|
|
|
import { Link, useParams } from "react-router-dom";
|
2024-07-08 20:14:34 +05:30
|
|
|
import AmountInvested from "./HeaderModal/AmountInvested";
|
|
|
|
|
import FeesExpenses from "./HeaderModal/FeesExpenses";
|
|
|
|
|
import DistributionSponsor from "./HeaderModal/DistributionSponsor";
|
|
|
|
|
import DistributionInvestor from "./HeaderModal/DistributionInvestor";
|
|
|
|
|
import UpdateIONav from "./HeaderModal/UpdateIONav";
|
|
|
|
|
import UpdateIOStatus from "./HeaderModal/UpdateIOStatus";
|
2024-07-10 12:02:35 +05:30
|
|
|
import { useContext, useRef } from "react";
|
|
|
|
|
import GlobalStateContext from "../../../Contexts/GlobalStateContext";
|
2024-07-15 12:27:23 +05:30
|
|
|
import Exit from "./HeaderModal/Exit";
|
|
|
|
|
import Cancle from "./HeaderModal/Cancle";
|
|
|
|
|
import { AddIcon } from "@chakra-ui/icons";
|
|
|
|
|
import { GrGallery } from "react-icons/gr";
|
2024-07-05 15:33:08 +05:30
|
|
|
|
|
|
|
|
const ViewIOdataHeader = () => {
|
2024-07-15 12:27:23 +05:30
|
|
|
const params = useParams();
|
2024-07-10 12:02:35 +05:30
|
|
|
const id = params?.id;
|
2024-07-08 20:14:34 +05:30
|
|
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
2024-07-09 12:25:52 +05:30
|
|
|
const btnRef = useRef();
|
2024-07-10 12:02:35 +05:30
|
|
|
const { IODetails } = useContext(GlobalStateContext);
|
|
|
|
|
const foundObject = IODetails?.find(
|
|
|
|
|
(item) => item?.id.toString() === id?.toString()
|
|
|
|
|
);
|
|
|
|
|
|
2024-07-08 20:14:34 +05:30
|
|
|
const {
|
|
|
|
|
isOpen: isInvestmentOpen,
|
|
|
|
|
onOpen: onInvestmentOpen,
|
|
|
|
|
onClose: onInvestmentClose,
|
|
|
|
|
} = useDisclosure();
|
|
|
|
|
const {
|
|
|
|
|
isOpen: isFeesOpen,
|
|
|
|
|
onOpen: onFeesOpen,
|
|
|
|
|
onClose: onFeesClose,
|
|
|
|
|
} = useDisclosure();
|
|
|
|
|
const {
|
|
|
|
|
isOpen: isDistSponsorOpen,
|
|
|
|
|
onOpen: onDistSponsorOpen,
|
|
|
|
|
onClose: onDistSponsorClose,
|
|
|
|
|
} = useDisclosure();
|
|
|
|
|
const {
|
|
|
|
|
isOpen: isDistInvestorOpen,
|
|
|
|
|
onOpen: onDistInvestorOpen,
|
|
|
|
|
onClose: onDistInvestorClose,
|
|
|
|
|
} = useDisclosure();
|
|
|
|
|
const {
|
|
|
|
|
isOpen: isUpdateNavOpen,
|
|
|
|
|
onOpen: onUpdateNavOpen,
|
|
|
|
|
onClose: onUpdateNavClose,
|
|
|
|
|
} = useDisclosure();
|
|
|
|
|
const {
|
|
|
|
|
isOpen: isUpdateStatusOpen,
|
|
|
|
|
onOpen: onUpdateStatusOpen,
|
|
|
|
|
onClose: onUpdateStatusClose,
|
|
|
|
|
} = useDisclosure();
|
2024-07-15 12:27:23 +05:30
|
|
|
const {
|
|
|
|
|
isOpen: isExitOpen,
|
|
|
|
|
onOpen: onExitOpen,
|
|
|
|
|
onClose: onExitClose,
|
|
|
|
|
} = useDisclosure();
|
|
|
|
|
const {
|
|
|
|
|
isOpen: isCancleOpen,
|
|
|
|
|
onOpen: onCancleOpen,
|
|
|
|
|
onClose: onCancleClose,
|
|
|
|
|
} = useDisclosure();
|
|
|
|
|
|
2024-07-08 20:14:34 +05:30
|
|
|
|
|
|
|
|
const bg = {
|
|
|
|
|
bg: "#fff",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const hover = {
|
|
|
|
|
textDecoration: "underline",
|
|
|
|
|
background: "#fff",
|
|
|
|
|
};
|
2024-07-09 13:13:39 +05:30
|
|
|
|
|
|
|
|
const style = {
|
|
|
|
|
fontSize: "0.875rem",
|
|
|
|
|
fontWeight: "400",
|
|
|
|
|
};
|
2024-07-05 15:33:08 +05:30
|
|
|
return (
|
|
|
|
|
<Box
|
|
|
|
|
display={"flex"}
|
|
|
|
|
alignItems={"center"}
|
2024-07-08 20:42:55 +05:30
|
|
|
justifyContent={"start"}
|
|
|
|
|
gap={14}
|
2024-07-05 15:33:08 +05:30
|
|
|
bg={"#caf5d8"}
|
2024-07-08 20:42:55 +05:30
|
|
|
rounded={"md"}
|
|
|
|
|
// bgGradient='linear(to-r, #caf5d8, #f5e8ca)'
|
|
|
|
|
// bgGradient='linear(to-r, #caf5d8, #d4a5a5)'
|
|
|
|
|
// bgGradient='linear(to-r, #caf5d8, #d4a5a5)'
|
|
|
|
|
// bgGradient='linear(to-r, #caf5d8, #b3e5fc)'
|
|
|
|
|
// bgGradient='linear(to-r, #ffd54f, #caf5d8)'
|
|
|
|
|
// bgGradient='linear(to-r, #caf5d8, #a8e6cf)'
|
2024-07-09 19:05:08 +05:30
|
|
|
boxShadow={"md"}
|
2024-07-08 20:14:34 +05:30
|
|
|
paddingRight={"10px"}
|
2024-07-05 15:33:08 +05:30
|
|
|
borderRadius={"10px"}
|
2024-07-09 19:05:08 +05:30
|
|
|
position={"relative"}
|
2024-07-05 15:33:08 +05:30
|
|
|
>
|
2024-07-15 12:27:23 +05:30
|
|
|
<Box h={100} w={200} p={1.5} >
|
|
|
|
|
{/* <Image rounded={'md'} h={"100%"} src={foundObject?.ioName} alt={foundObject?.ioName}/> */}
|
|
|
|
|
<Box w={'100%'} h={'100%'} display={'flex'} justifyContent={'center'} alignItems={'center'} bg={"#fff"} rounded={'md'}>
|
|
|
|
|
<Icon color={'gray.700'} as={GrGallery} />
|
|
|
|
|
</Box>
|
2024-07-05 15:33:08 +05:30
|
|
|
</Box>
|
2024-07-10 12:02:35 +05:30
|
|
|
{/* <Box display={"flex"} flexDirection={"column"} gap={2}>
|
|
|
|
|
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
|
|
|
|
|
IO name: <Text as={'span'} ms={2}>{foundObject?.ioName}</Text>
|
|
|
|
|
</Text>
|
|
|
|
|
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
|
|
|
|
|
Sponsor name: <Text as={'span'} ms={2}>{foundObject?.sponserName}</Text>
|
|
|
|
|
</Text>
|
|
|
|
|
</Box> */}
|
|
|
|
|
|
2024-07-15 12:27:23 +05:30
|
|
|
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
2024-07-10 12:02:35 +05:30
|
|
|
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
|
|
|
|
|
IO Name
|
|
|
|
|
</Text>
|
2024-07-09 19:05:08 +05:30
|
|
|
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
|
2024-07-15 12:27:23 +05:30
|
|
|
{id ? foundObject?.ioName : "---"}
|
2024-07-10 12:02:35 +05:30
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
|
|
|
|
|
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
|
|
|
|
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
|
2024-07-11 11:46:48 +05:30
|
|
|
Sponsorer Name
|
2024-07-09 19:05:08 +05:30
|
|
|
</Text>
|
|
|
|
|
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
|
2024-07-15 12:27:23 +05:30
|
|
|
{id ? foundObject?.sponserName : "---"}
|
2024-07-09 19:05:08 +05:30
|
|
|
</Text>
|
2024-07-05 15:33:08 +05:30
|
|
|
</Box>
|
2024-07-10 12:02:35 +05:30
|
|
|
|
2024-07-09 19:05:08 +05:30
|
|
|
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
|
|
|
|
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
|
|
|
|
|
IO Status
|
|
|
|
|
</Text>
|
2024-07-10 12:02:35 +05:30
|
|
|
<Badge
|
2024-07-15 12:27:23 +05:30
|
|
|
rounded={"md"}
|
2024-07-10 12:02:35 +05:30
|
|
|
pt={0.5}
|
|
|
|
|
pb={0.5}
|
|
|
|
|
ps={4}
|
|
|
|
|
pe={4}
|
2024-07-15 12:27:23 +05:30
|
|
|
textTransform={"none"}
|
2024-07-10 12:02:35 +05:30
|
|
|
color={
|
|
|
|
|
foundObject?.ioStatus === "Open"
|
|
|
|
|
? "#00B69B"
|
|
|
|
|
: foundObject?.ioStatus === "Pending"
|
|
|
|
|
? "#6226EF"
|
|
|
|
|
: "#EF3826"
|
|
|
|
|
}
|
|
|
|
|
colorScheme={
|
|
|
|
|
foundObject?.ioStatus === "Open"
|
|
|
|
|
? "green"
|
|
|
|
|
: foundObject?.ioStatus === "Pending"
|
|
|
|
|
? "purple"
|
|
|
|
|
: "red"
|
|
|
|
|
}
|
|
|
|
|
>
|
2024-07-15 12:27:23 +05:30
|
|
|
{id ? foundObject?.ioStatus : "---"}
|
2024-07-09 19:05:08 +05:30
|
|
|
</Badge>
|
2024-07-05 15:33:08 +05:30
|
|
|
</Box>
|
2024-07-09 19:05:08 +05:30
|
|
|
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
|
|
|
|
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
|
|
|
|
|
IO MV NAV
|
|
|
|
|
</Text>
|
|
|
|
|
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
|
2024-07-15 12:27:23 +05:30
|
|
|
{id ? "$42012.00" : "---"}
|
2024-07-09 19:05:08 +05:30
|
|
|
</Text>
|
2024-07-05 15:33:08 +05:30
|
|
|
</Box>
|
2024-07-09 19:05:08 +05:30
|
|
|
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
|
|
|
|
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
|
|
|
|
|
IO cash
|
|
|
|
|
</Text>
|
|
|
|
|
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
|
2024-07-15 12:27:23 +05:30
|
|
|
{id ? "$48,000" : "---"}
|
2024-07-09 19:05:08 +05:30
|
|
|
</Text>
|
2024-07-05 15:33:08 +05:30
|
|
|
</Box>
|
2024-07-09 19:05:08 +05:30
|
|
|
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
|
|
|
|
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
|
|
|
|
|
IO NAV
|
|
|
|
|
</Text>
|
|
|
|
|
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
|
2024-07-15 12:27:23 +05:30
|
|
|
{id ? "$1,140,500" : "---"}
|
2024-07-09 19:05:08 +05:30
|
|
|
</Text>
|
2024-07-05 15:33:08 +05:30
|
|
|
</Box>
|
2024-07-08 20:14:34 +05:30
|
|
|
|
2024-07-09 19:05:08 +05:30
|
|
|
<Box
|
|
|
|
|
position={"absolute"}
|
|
|
|
|
right={3}
|
|
|
|
|
top={2}
|
|
|
|
|
display={"flex"}
|
|
|
|
|
alignItems={"start"}
|
|
|
|
|
height={"95px"}
|
|
|
|
|
>
|
2024-07-08 20:14:34 +05:30
|
|
|
<Menu>
|
|
|
|
|
<MenuButton
|
2024-07-09 19:05:08 +05:30
|
|
|
className="link p-1 rounded-1 "
|
2024-07-08 20:14:34 +05:30
|
|
|
bg={"#fff"}
|
|
|
|
|
_hover={{ backgroundColor: "#fff !important" }}
|
|
|
|
|
onClick={onOpen}
|
2024-07-09 12:25:52 +05:30
|
|
|
ref={btnRef}
|
2024-07-08 20:14:34 +05:30
|
|
|
>
|
|
|
|
|
<HiDotsVertical className="rubix-text-dark fs-6" />
|
|
|
|
|
</MenuButton>
|
2024-07-09 19:05:08 +05:30
|
|
|
<MenuList fontSize={"sm"}>
|
2024-07-15 12:27:23 +05:30
|
|
|
<MenuItem
|
|
|
|
|
_hover={{
|
|
|
|
|
bg: "#fff",
|
|
|
|
|
}}
|
|
|
|
|
as={"span"}
|
|
|
|
|
fontWeight={600}
|
|
|
|
|
className="border-bottom"
|
|
|
|
|
>
|
2024-07-09 19:05:08 +05:30
|
|
|
Tansaction
|
|
|
|
|
</MenuItem>
|
2024-07-15 12:27:23 +05:30
|
|
|
<MenuItem onClick={onInvestmentOpen} className="border-bottom">
|
|
|
|
|
Amount Invested
|
|
|
|
|
</MenuItem>
|
|
|
|
|
<MenuItem onClick={onFeesOpen} className="border-bottom">
|
|
|
|
|
Fees & Expenses
|
|
|
|
|
</MenuItem>
|
2024-07-09 19:05:08 +05:30
|
|
|
<MenuItem onClick={onDistSponsorOpen} className="border-bottom">
|
|
|
|
|
Distribution from Sponsors
|
|
|
|
|
</MenuItem>
|
2024-07-15 12:27:23 +05:30
|
|
|
<MenuItem onClick={onDistInvestorOpen} className="border-bottom">
|
2024-07-09 19:05:08 +05:30
|
|
|
Distribution To investors
|
|
|
|
|
</MenuItem>
|
2024-07-15 12:27:23 +05:30
|
|
|
<MenuItem onClick={onUpdateNavOpen} className="border-bottom">
|
|
|
|
|
Update iO NAV
|
|
|
|
|
</MenuItem>
|
|
|
|
|
<MenuItem onClick={onExitOpen} className="border-bottom">Exit</MenuItem>
|
|
|
|
|
<MenuItem onClick={onCancleOpen} className="border-bottom">Cancel</MenuItem>
|
|
|
|
|
<MenuItem onClick={onUpdateStatusOpen}>Update iO status</MenuItem>
|
2024-07-09 13:05:58 +05:30
|
|
|
</MenuList>
|
2024-07-08 20:14:34 +05:30
|
|
|
</Menu>
|
|
|
|
|
|
2024-07-09 12:25:52 +05:30
|
|
|
{/* Drawer */}
|
2024-07-09 13:05:58 +05:30
|
|
|
{/* <Drawer
|
2024-07-09 12:25:52 +05:30
|
|
|
isOpen={isOpen}
|
|
|
|
|
placement="right"
|
|
|
|
|
onClose={onClose}
|
|
|
|
|
finalFocusRef={btnRef}
|
|
|
|
|
>
|
|
|
|
|
<DrawerOverlay />
|
|
|
|
|
<DrawerContent>
|
|
|
|
|
<DrawerCloseButton />
|
|
|
|
|
<DrawerHeader>Transaction</DrawerHeader>
|
|
|
|
|
|
|
|
|
|
<DrawerBody>
|
2024-07-08 20:14:34 +05:30
|
|
|
<Box
|
|
|
|
|
display={"grid"}
|
|
|
|
|
alignContent={"left"}
|
|
|
|
|
justifyItems={"start"}
|
|
|
|
|
>
|
2024-07-09 12:25:52 +05:30
|
|
|
<Button
|
|
|
|
|
onClick={onInvestmentOpen}
|
|
|
|
|
bg={bg}
|
|
|
|
|
_hover={hover}
|
|
|
|
|
paddingInline={"0px"}
|
|
|
|
|
>
|
2024-07-08 20:14:34 +05:30
|
|
|
Amount Invested
|
|
|
|
|
</Button>
|
|
|
|
|
<Divider />
|
2024-07-09 12:25:52 +05:30
|
|
|
<Button
|
|
|
|
|
onClick={onFeesOpen}
|
|
|
|
|
bg={bg}
|
|
|
|
|
_hover={hover}
|
|
|
|
|
paddingInline={"0px"}
|
|
|
|
|
>
|
2024-07-08 20:14:34 +05:30
|
|
|
Fees & Expenses
|
|
|
|
|
</Button>
|
|
|
|
|
<Divider />
|
2024-07-09 12:25:52 +05:30
|
|
|
<Button
|
|
|
|
|
onClick={onDistSponsorOpen}
|
|
|
|
|
bg={bg}
|
|
|
|
|
_hover={hover}
|
|
|
|
|
paddingInline={"0px"}
|
|
|
|
|
>
|
2024-07-08 20:14:34 +05:30
|
|
|
Distribution from Sponsors
|
|
|
|
|
</Button>
|
|
|
|
|
<Divider />
|
2024-07-09 12:25:52 +05:30
|
|
|
<Button
|
|
|
|
|
onClick={onDistInvestorOpen}
|
|
|
|
|
bg={bg}
|
|
|
|
|
_hover={hover}
|
|
|
|
|
paddingInline={"0px"}
|
|
|
|
|
>
|
2024-07-08 20:14:34 +05:30
|
|
|
Distribution To Investors
|
|
|
|
|
</Button>
|
|
|
|
|
<Divider />
|
2024-07-09 12:25:52 +05:30
|
|
|
<Button
|
|
|
|
|
onClick={onUpdateNavOpen}
|
|
|
|
|
bg={bg}
|
|
|
|
|
_hover={hover}
|
|
|
|
|
paddingInline={"0px"}
|
|
|
|
|
>
|
2024-07-08 20:14:34 +05:30
|
|
|
Update IO NAV
|
|
|
|
|
</Button>
|
|
|
|
|
<Divider />
|
|
|
|
|
<Button
|
2024-07-09 12:25:52 +05:30
|
|
|
onClick={onUpdateStatusOpen}
|
2024-07-08 20:14:34 +05:30
|
|
|
bg={bg}
|
|
|
|
|
_hover={hover}
|
2024-07-09 12:25:52 +05:30
|
|
|
paddingInline={"0px"}
|
2024-07-08 20:14:34 +05:30
|
|
|
>
|
2024-07-09 12:25:52 +05:30
|
|
|
Update IO Status
|
2024-07-08 20:14:34 +05:30
|
|
|
</Button>
|
|
|
|
|
<Divider />
|
|
|
|
|
</Box>
|
2024-07-09 12:25:52 +05:30
|
|
|
</DrawerBody>
|
|
|
|
|
|
|
|
|
|
<DrawerFooter>
|
|
|
|
|
<Button variant="outline" mr={3} onClick={onClose}>
|
|
|
|
|
Cancel
|
|
|
|
|
</Button>
|
|
|
|
|
</DrawerFooter>
|
|
|
|
|
</DrawerContent>
|
2024-07-09 13:05:58 +05:30
|
|
|
</Drawer> */}
|
2024-07-08 20:14:34 +05:30
|
|
|
|
|
|
|
|
{/* Modals */}
|
|
|
|
|
<AmountInvested isOpen={isInvestmentOpen} onClose={onInvestmentClose} />
|
|
|
|
|
<FeesExpenses isOpen={isFeesOpen} onClose={onFeesClose} />
|
2024-07-15 12:27:23 +05:30
|
|
|
<Exit isOpen={isExitOpen} onClose={onExitClose} />
|
|
|
|
|
<Cancle isOpen={isCancleOpen} onClose={onCancleClose} />
|
2024-07-08 20:14:34 +05:30
|
|
|
<DistributionSponsor
|
|
|
|
|
isOpen={isDistSponsorOpen}
|
|
|
|
|
onClose={onDistSponsorClose}
|
|
|
|
|
/>
|
|
|
|
|
<DistributionInvestor
|
|
|
|
|
isOpen={isDistInvestorOpen}
|
|
|
|
|
onClose={onDistInvestorClose}
|
|
|
|
|
/>
|
|
|
|
|
<UpdateIONav isOpen={isUpdateNavOpen} onClose={onUpdateNavClose} />
|
|
|
|
|
<UpdateIOStatus
|
|
|
|
|
isOpen={isUpdateStatusOpen}
|
|
|
|
|
onClose={onUpdateStatusClose}
|
|
|
|
|
/>
|
|
|
|
|
</Box>
|
2024-07-05 15:33:08 +05:30
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default ViewIOdataHeader;
|