From 2931f6ba55548db5d1c223efd8dfa3eead1981ae Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Thu, 31 Jul 2025 15:45:07 +0800 Subject: [PATCH] Investment Add: - screens/Invesment/DetailDataPublishSection.tsx - screens/Invesment/BoxProgressSection.tsx - app/(application)/(user)/investment/[id]/(transaction-flow) ## No Issue --- app/(application)/(user)/_layout.tsx | 8 + .../[id]/(transaction-flow)/index.tsx | 13 ++ .../investment/[id]/[status]/detail.tsx | 52 ++----- .../(user)/investment/[id]/index.tsx | 139 +++++++++++++++++- screens/Invesment/BoxProgressSection.tsx | 16 ++ screens/Invesment/ButtonInvestasiSection.tsx | 11 +- .../Invesment/DetailDataPublishSection.tsx | 35 +++++ 7 files changed, 229 insertions(+), 45 deletions(-) create mode 100644 app/(application)/(user)/investment/[id]/(transaction-flow)/index.tsx create mode 100644 screens/Invesment/BoxProgressSection.tsx create mode 100644 screens/Invesment/DetailDataPublishSection.tsx diff --git a/app/(application)/(user)/_layout.tsx b/app/(application)/(user)/_layout.tsx index 6276237..91f8b58 100644 --- a/app/(application)/(user)/_layout.tsx +++ b/app/(application)/(user)/_layout.tsx @@ -266,6 +266,14 @@ export default function UserLayout() { }} /> + , + }} + /> + {/* ========== End Investment Section ========= */} {/* ========== Donation Section ========= */} diff --git a/app/(application)/(user)/investment/[id]/(transaction-flow)/index.tsx b/app/(application)/(user)/investment/[id]/(transaction-flow)/index.tsx new file mode 100644 index 0000000..bf83478 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/index.tsx @@ -0,0 +1,13 @@ +import { TextCustom, ViewWrapper } from "@/components"; +import { useLocalSearchParams } from "expo-router"; + +export default function InvestmentInvest() { + const { id } = useLocalSearchParams(); + return ( + <> + + Pembelian Saham {id} + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/[status]/detail.tsx b/app/(application)/(user)/investment/[id]/[status]/detail.tsx index 6a0374d..91b0ec8 100644 --- a/app/(application)/(user)/investment/[id]/[status]/detail.tsx +++ b/app/(application)/(user)/investment/[id]/[status]/detail.tsx @@ -1,27 +1,17 @@ import { - BackButton, - BaseBox, - DotButton, - DrawerCustom, - MenuDrawerDynamicGrid, - ProgressCustom, - Spacing, - StackCustom, - TextCustom, - ViewWrapper + BackButton, + DotButton, + DrawerCustom, + MenuDrawerDynamicGrid, + 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 { - listDataNotPublishInvesment, - listDataPublishInvesment, -} from "@/lib/dummy-data/investment/dummy-data-not-publish"; -import Invesment_BoxDetailDataSection from "@/screens/Invesment/BoxDetailDataSection"; import Investment_ButtonInvestasiSection from "@/screens/Invesment/ButtonInvestasiSection"; -import Investment_ButtonStatusSection from "@/screens/Invesment/ButtonStatusSection"; 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"; @@ -51,6 +41,10 @@ export default function InvestmentDetailStatus() { /> ); + const buttonSection = ( + + ); + return ( <> - - {status === "publish" && ( - - - Progress Saham - - - - )} - - - - - + {/* ========= Draft Drawer ========= */} diff --git a/app/(application)/(user)/investment/[id]/index.tsx b/app/(application)/(user)/investment/[id]/index.tsx index 5825d0c..a94f11e 100644 --- a/app/(application)/(user)/investment/[id]/index.tsx +++ b/app/(application)/(user)/investment/[id]/index.tsx @@ -1,9 +1,134 @@ -import { TextCustom, ViewWrapper } from "@/components"; +import { + BackButton, + DotButton, + DrawerCustom, + MenuDrawerDynamicGrid, + 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 Investment_ButtonInvestasiSection from "@/screens/Invesment/ButtonInvestasiSection"; +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 InvestmentDetail() { - return ( - - Investment Detail - - ) -} \ No newline at end of file + 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 = ( + + ); + + const buttonSection = ; + + return ( + <> + , + headerRight: () => + status === "draft" ? ( + setOpenDrawerDraft(true)} /> + ) : status === "publish" ? ( + setOpenDrawerPublish(true)} /> + ) : null, + }} + /> + + + + + + {/* ========= 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/BoxProgressSection.tsx b/screens/Invesment/BoxProgressSection.tsx new file mode 100644 index 0000000..dedd31c --- /dev/null +++ b/screens/Invesment/BoxProgressSection.tsx @@ -0,0 +1,16 @@ +import { BaseBox, StackCustom, TextCustom, ProgressCustom } from "@/components"; + +export default function Invesment_BoxProgressSection({status}: {status: string}) { + return ( + <> + {status === "publish" && ( + + + Progress Saham + + + + )} + + ); +} \ No newline at end of file diff --git a/screens/Invesment/ButtonInvestasiSection.tsx b/screens/Invesment/ButtonInvestasiSection.tsx index 1a7aa9f..7b90e2e 100644 --- a/screens/Invesment/ButtonInvestasiSection.tsx +++ b/screens/Invesment/ButtonInvestasiSection.tsx @@ -1,14 +1,23 @@ import { ButtonCustom } from "@/components"; +import { router } from "expo-router"; export default function Investment_ButtonInvestasiSection({ + id, isMine, }: { + id: string; isMine: boolean; }) { return ( <> {isMine ? ( - Beli Saham + { + router.navigate(`/investment/${id}/(transaction-flow)`); + }} + > + Beli Saham + ) : ( Investasi Ini Milik Anda )} diff --git a/screens/Invesment/DetailDataPublishSection.tsx b/screens/Invesment/DetailDataPublishSection.tsx new file mode 100644 index 0000000..3292688 --- /dev/null +++ b/screens/Invesment/DetailDataPublishSection.tsx @@ -0,0 +1,35 @@ +import { Spacing, StackCustom } from "@/components"; +import { listDataNotPublishInvesment, listDataPublishInvesment } from "@/lib/dummy-data/investment/dummy-data-not-publish"; +import React from "react"; +import Invesment_BoxDetailDataSection from "./BoxDetailDataSection"; +import Invesment_BoxProgressSection from "./BoxProgressSection"; +import Investment_ButtonStatusSection from "./ButtonStatusSection"; + +export default function Invesment_DetailDataPublishSection({ + status, + bottomSection, + buttonSection, +}: { + status: string; + bottomSection: React.ReactNode; + buttonSection: React.ReactNode +}) { + return ( + <> + + + + + {buttonSection} + + + + ); +} \ No newline at end of file