diff --git a/app/(application)/(user)/_layout.tsx b/app/(application)/(user)/_layout.tsx index 5a5a328..e32b193 100644 --- a/app/(application)/(user)/_layout.tsx +++ b/app/(application)/(user)/_layout.tsx @@ -330,6 +330,13 @@ export default function UserLayout() { }} /> + , + }} + /> {/* ========== End Investment Section ========= */} {/* ========== Donation Section ========= */} diff --git a/app/(application)/(user)/investment/(tabs)/my-holding.tsx b/app/(application)/(user)/investment/(tabs)/my-holding.tsx index 9433185..ccdb619 100644 --- a/app/(application)/(user)/investment/(tabs)/my-holding.tsx +++ b/app/(application)/(user)/investment/(tabs)/my-holding.tsx @@ -7,13 +7,14 @@ import { TextCustom, ViewWrapper, } from "@/components"; +import { router } from "expo-router"; import { View } from "react-native"; export default function InvestmentMyHolding() { return ( {Array.from({ length: 10 }).map((_, index) => ( - + router.push(`/investment/${index}/(my-holding)/holding-${index}`)}> diff --git a/app/(application)/(user)/investment/[id]/(my-holding)/[id].tsx b/app/(application)/(user)/investment/[id]/(my-holding)/[id].tsx new file mode 100644 index 0000000..ae0dc73 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(my-holding)/[id].tsx @@ -0,0 +1,154 @@ +import { + BackButton, + BaseBox, + DotButton, + DrawerCustom, + Grid, + MenuDrawerDynamicGrid, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { IconDocument, IconEdit, IconNews } from "@/components/_Icon"; +import { IMenuDrawerItem } from "@/components/_Interface/types"; +import { MainColor } from "@/constants/color-palet"; +import { ICON_SIZE_MEDIUM } from "@/constants/constans-value"; +import Invesment_ComponentBoxOnBottomDetail from "@/screens/Invesment/ComponentBoxOnBottomDetail"; +import Invesment_DetailDataPublishSection from "@/screens/Invesment/DetailDataPublishSection"; +import { AntDesign, MaterialIcons } from "@expo/vector-icons"; +import { router, Stack, useLocalSearchParams } from "expo-router"; +import _ from "lodash"; +import { useState } from "react"; + +export default function InvestmentDetailHolding() { + const { id, status } = useLocalSearchParams(); + const [openDrawerDraft, setOpenDrawerDraft] = useState(false); + const [openDrawerPublish, setOpenDrawerPublish] = useState(false); + + const handlePressDraft = (item: IMenuDrawerItem) => { + console.log("PATH >> ", item.path); + router.navigate(item.path as any); + setOpenDrawerDraft(false); + }; + + const handlePressPublish = (item: IMenuDrawerItem) => { + console.log("PATH >> ", item.path); + router.navigate(item.path as any); + setOpenDrawerPublish(false); + }; + + const bottomSection = ( + + ); + + return ( + <> + , + headerRight: () => + status === "draft" ? ( + setOpenDrawerDraft(true)} /> + ) : status === "publish" ? ( + setOpenDrawerPublish(true)} /> + ) : null, + }} + /> + + + + + + + Nila Transaksi + + + Rp. 7.500.000 + + + + + Saham Terbeli + + + 300 Lembar + + + + + + + + {/* ========= Draft Drawer ========= */} + setOpenDrawerDraft(false)} + height={"auto"} + > + , + label: "Edit Data", + path: `/investment/${id}/edit`, + }, + { + icon: ( + + ), + label: "Edit Prospektus", + path: `/investment/${id}/edit-prospectus`, + }, + { + icon: ( + + ), + label: "Update Dokumen", + path: `/investment/${id}/recap-of-document`, + }, + ]} + columns={4} + onPressItem={handlePressDraft as any} + /> + + + {/* ========= Publish Drawer ========= */} + setOpenDrawerPublish(false)} + height={"auto"} + > + , + label: "Update Dokumen", + path: `/investment/${id}/recap-of-document`, + }, + { + icon: , + label: "Update Berita", + path: `/investment/${id}/(news)/recap-of-news`, + }, + ]} + onPressItem={handlePressPublish as any} + /> + + + ); +} diff --git a/screens/Invesment/DetailDataPublishSection.tsx b/screens/Invesment/DetailDataPublishSection.tsx index a9a32fb..5d43ce9 100644 --- a/screens/Invesment/DetailDataPublishSection.tsx +++ b/screens/Invesment/DetailDataPublishSection.tsx @@ -14,8 +14,8 @@ export default function Invesment_DetailDataPublishSection({ buttonSection, }: { status: string; - bottomSection: React.ReactNode; - buttonSection: React.ReactNode; + bottomSection?: React.ReactNode; + buttonSection?: React.ReactNode; }) { return ( <>