From b3be6a7f538caadaf8855753246762767c869272 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Wed, 30 Jul 2025 16:55:37 +0800 Subject: [PATCH] Invesment Add: - app/(application)/(user)/investment/[id]/[file]/ - app/(application)/(user)/investment/[id]/add-document.tsx - app/(application)/(user)/investment/[id]/edit-document.tsx - app/(application)/(user)/investment/[id]/edit-prospectus.tsx - app/(application)/(user)/investment/[id]/recap-of-document.tsx Fix: - app/(application)/(user)/investment/[id]/list-of-document.tsx - app/(application)/(user)/investment/[id]/edit.tsx - app/(application)/(user)/investment/[id]/[status]/detail.tsx ## No Issue --- app/(application)/(user)/_layout.tsx | 22 +++ .../(user)/investment/[id]/[file]/file.tsx | 20 +++ .../investment/[id]/[status]/detail.tsx | 33 +++- .../(user)/investment/[id]/add-document.tsx | 58 +++++++ .../(user)/investment/[id]/edit-document.tsx | 58 +++++++ .../investment/[id]/edit-prospectus.tsx | 46 +++++ .../(user)/investment/[id]/edit.tsx | 159 +++++++++++++++++- .../investment/[id]/list-of-document.tsx | 11 +- .../investment/[id]/recap-of-document.tsx | 133 +++++++++++++++ components/Box/InformationBox.tsx | 2 +- screens/Authentication/LoginView.tsx | 3 +- screens/Invesment/Document/RecapBoxDetail.tsx | 28 +++ 12 files changed, 565 insertions(+), 8 deletions(-) create mode 100644 app/(application)/(user)/investment/[id]/[file]/file.tsx create mode 100644 app/(application)/(user)/investment/[id]/add-document.tsx create mode 100644 app/(application)/(user)/investment/[id]/edit-document.tsx create mode 100644 app/(application)/(user)/investment/[id]/edit-prospectus.tsx create mode 100644 app/(application)/(user)/investment/[id]/recap-of-document.tsx create mode 100644 screens/Invesment/Document/RecapBoxDetail.tsx diff --git a/app/(application)/(user)/_layout.tsx b/app/(application)/(user)/_layout.tsx index 5c10d0d..2eced86 100644 --- a/app/(application)/(user)/_layout.tsx +++ b/app/(application)/(user)/_layout.tsx @@ -228,6 +228,28 @@ export default function UserLayout() { headerLeft: () => , }} /> + , + }} + /> + , + }} + /> + , + }} + /> + {/* ========== End Investment Section ========= */} diff --git a/app/(application)/(user)/investment/[id]/[file]/file.tsx b/app/(application)/(user)/investment/[id]/[file]/file.tsx new file mode 100644 index 0000000..89cfab9 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/[file]/file.tsx @@ -0,0 +1,20 @@ +import { BackButton, TextCustom, ViewWrapper } from "@/components"; +import { Stack, useLocalSearchParams } from "expo-router"; +import _ from "lodash"; + +export default function InvestmentProspectus() { + const { file } = useLocalSearchParams(); + return ( + <> + , + }} + /> + + Pratinjau File + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/[status]/detail.tsx b/app/(application)/(user)/investment/[id]/[status]/detail.tsx index 1fb25fa..ea0569b 100644 --- a/app/(application)/(user)/investment/[id]/[status]/detail.tsx +++ b/app/(application)/(user)/investment/[id]/[status]/detail.tsx @@ -17,8 +17,14 @@ import { import { IconEdit } from "@/components/_Icon"; import { IMenuDrawerItem } from "@/components/_Interface/types"; import { AccentColor, MainColor } from "@/constants/color-palet"; +import { ICON_SIZE_MEDIUM } from "@/constants/constans-value"; import Investment_ButtonStatusSection from "@/screens/Invesment/ButtonStatusSection"; -import { FontAwesome6 } from "@expo/vector-icons"; +import { + AntDesign, + FontAwesome6, + Ionicons, + MaterialIcons, +} from "@expo/vector-icons"; import { router, Stack, useLocalSearchParams } from "expo-router"; import _ from "lodash"; import { useState } from "react"; @@ -78,6 +84,7 @@ export default function InvestmentDetailStatus() { Prospektus @@ -127,9 +134,31 @@ export default function InvestmentDetailStatus() { data={[ { icon: , - label: "Edit", + 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} diff --git a/app/(application)/(user)/investment/[id]/add-document.tsx b/app/(application)/(user)/investment/[id]/add-document.tsx new file mode 100644 index 0000000..cf92f61 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/add-document.tsx @@ -0,0 +1,58 @@ +import { + BaseBox, + BoxButtonOnFooter, + ButtonCenteredOnly, + ButtonCustom, + CenterCustom, + InformationBox, + Spacing, + StackCustom, + TextInputCustom, + ViewWrapper +} from "@/components"; +import { MainColor } from "@/constants/color-palet"; +import { FontAwesome5 } from "@expo/vector-icons"; +import { router } from "expo-router"; + +export default function InvestmentAddDocument() { + const buttonFooter = ( + + router.back()}>Simpan + + ); + + return ( + <> + + + + + + + + + + + + + + router.push("/(application)/(image)/take-picture/123") + } + > + Upload + + + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/edit-document.tsx b/app/(application)/(user)/investment/[id]/edit-document.tsx new file mode 100644 index 0000000..86e1136 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/edit-document.tsx @@ -0,0 +1,58 @@ +import { + BaseBox, + BoxButtonOnFooter, + ButtonCenteredOnly, + ButtonCustom, + CenterCustom, + InformationBox, + Spacing, + StackCustom, + TextInputCustom, + ViewWrapper, +} from "@/components"; +import { MainColor } from "@/constants/color-palet"; +import { FontAwesome5 } from "@expo/vector-icons"; +import { router } from "expo-router"; + +export default function InvestmentEditDocument() { + const buttonFooter = ( + + router.back()}>Update + + ); + + return ( + <> + + + + + + + + + + + + + + router.push("/(application)/(image)/take-picture/123") + } + > + Upload + + + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/edit-prospectus.tsx b/app/(application)/(user)/investment/[id]/edit-prospectus.tsx new file mode 100644 index 0000000..c74d04e --- /dev/null +++ b/app/(application)/(user)/investment/[id]/edit-prospectus.tsx @@ -0,0 +1,46 @@ +import { + BaseBox, + BoxButtonOnFooter, + ButtonCenteredOnly, + ButtonCustom, + CenterCustom, + InformationBox, + Spacing, + StackCustom, + ViewWrapper, +} from "@/components"; +import { MainColor } from "@/constants/color-palet"; +import { FontAwesome5 } from "@expo/vector-icons"; +import { router } from "expo-router"; + +export default function InvestmentEditProspectus() { + const buttonFooter = ( + + router.back()}>Update + + ); + return ( + + + + + + + + + + + router.push("/(application)/(image)/take-picture/123")} + > + Upload + + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/edit.tsx b/app/(application)/(user)/investment/[id]/edit.tsx index 8811af8..0008f97 100644 --- a/app/(application)/(user)/investment/[id]/edit.tsx +++ b/app/(application)/(user)/investment/[id]/edit.tsx @@ -1,9 +1,164 @@ -import { TextCustom, ViewWrapper } from "@/components"; +import { + ButtonCenteredOnly, + ButtonCustom, + InformationBox, + LandscapeFrameUploaded, + SelectCustom, + Spacing, + StackCustom, + TextInputCustom, + ViewWrapper +} from "@/components"; +import dummyPembagianDeviden from "@/lib/dummy-data/investment/pembagian-deviden"; +import dummyListPencarianInvestor from "@/lib/dummy-data/investment/pencarian-investor"; +import dummyPeriodeDeviden from "@/lib/dummy-data/investment/periode-deviden"; +import { router } from "expo-router"; +import { useState } from "react"; export default function InvestmentEdit() { + const [data, setData] = useState({ + title: "", + targetDana: 0, + hargaPerLembar: 0, + totalLembar: 0, + rasioKeuntungan: 0, + pencarianInvestor: "", + periodeDeviden: "", + pembagianDeviden: "", + }); + return ( - Edit + + + + router.push("/take-picture/1")} + > + Upload + + + + + + + setData({ ...data, title: value })} + /> + + + setData({ ...data, targetDana: Number(value) }) + } + value={data.targetDana === 0 ? "" : data.targetDana.toString()} + /> + + + setData({ ...data, targetDana: Number(value) }) + } + value={data.targetDana === 0 ? "" : data.targetDana.toString()} + /> + + + setData({ ...data, targetDana: Number(value) }) + } + value={data.targetDana === 0 ? "" : data.targetDana.toString()} + /> + + + setData({ ...data, totalLembar: Number(value) }) + } + value={data.totalLembar === 0 ? "" : data.totalLembar.toString()} + /> + + + setData({ ...data, rasioKeuntungan: Number(value) }) + } + value={ + data.rasioKeuntungan === 0 ? "" : data.rasioKeuntungan.toString() + } + /> + + ({ + label: item.name + `${" "}hari`, + value: item.id, + }))} + onChange={(value) => + setData({ ...data, pencarianInvestor: value as any }) + } + value={data.pencarianInvestor} + /> + + ({ + label: item.name, + value: item.id, + }))} + onChange={(value) => + setData({ ...data, periodeDeviden: value as any }) + } + value={data.periodeDeviden} + /> + + ({ + label: item.name + `${" "}bulan`, + value: item.id, + }))} + onChange={(value) => + setData({ ...data, pembagianDeviden: value as any }) + } + value={data.pembagianDeviden} + /> + + router.replace("/investment/portofolio")}> + Simpan + + + ); } diff --git a/app/(application)/(user)/investment/[id]/list-of-document.tsx b/app/(application)/(user)/investment/[id]/list-of-document.tsx index abda925..0372189 100644 --- a/app/(application)/(user)/investment/[id]/list-of-document.tsx +++ b/app/(application)/(user)/investment/[id]/list-of-document.tsx @@ -1,9 +1,16 @@ -import { TextCustom, ViewWrapper } from "@/components"; +import { ViewWrapper } from "@/components"; +import Investment_BoxDetailDocument from "@/screens/Invesment/Document/RecapBoxDetail"; export default function InvestmentListOfDocument() { return ( - Document List + {Array.from({ length: 10 }).map((_, index) => ( + + ))} ); } diff --git a/app/(application)/(user)/investment/[id]/recap-of-document.tsx b/app/(application)/(user)/investment/[id]/recap-of-document.tsx new file mode 100644 index 0000000..d4d7cda --- /dev/null +++ b/app/(application)/(user)/investment/[id]/recap-of-document.tsx @@ -0,0 +1,133 @@ +import { + AlertDefaultSystem, + BackButton, + DotButton, + DrawerCustom, + MenuDrawerDynamicGrid, + ViewWrapper, +} from "@/components"; +import { IconEdit } from "@/components/_Icon"; +import { MainColor } from "@/constants/color-palet"; +import { ICON_SIZE_SMALL } from "@/constants/constans-value"; +import Investment_BoxDetailDocument from "@/screens/Invesment/Document/RecapBoxDetail"; +import { AntDesign, Ionicons } from "@expo/vector-icons"; +import { router, Stack, useLocalSearchParams } from "expo-router"; +import { useState } from "react"; + +export default function InvestmentRecapOfDocument() { + const { id } = useLocalSearchParams(); + const [openDrawer, setOpenDrawer] = useState(false); + const [openDrawerBox, setOpenDrawerBox] = useState(false); + + return ( + <> + , + headerRight: () => ( + { + setOpenDrawer(true); + setOpenDrawerBox(false); + }} + /> + ), + }} + /> + + + {Array.from({ length: 10 }).map((_, index) => ( + setOpenDrawerBox(true)} + /> + } + href={`/investment/${id}/dokumen/file`} + /> + ))} + + + {/* Drawer On Header */} + setOpenDrawer(false)} + height={"auto"} + > + + ), + label: "Tambah Dokumen", + path: `/investment/${id}/add-document`, + }, + ]} + onPressItem={(item) => { + router.push(item.path as any); + setOpenDrawer(false); + }} + /> + + + {/* Drawer On Box */} + setOpenDrawerBox(false)} + height={"auto"} + > + , + label: "Edit Dokumen", + path: `/investment/${id}/edit-document`, + }, + { + icon: ( + + ), + label: "Hapus Dokumen", + path: "" as any, + color: MainColor.red, + }, + ]} + onPressItem={(item) => { + if (item.path === ("" as any)) { + AlertDefaultSystem({ + title: "Hapus Dokumen", + message: "Apakah anda yakin ingin menghapus dokumen ini?", + textLeft: "Batal", + textRight: "Hapus", + onPressRight: () => { + setOpenDrawerBox(false); + }, + }); + } + router.push(item.path as any); + setOpenDrawer(false); + }} + /> + + + ); +} diff --git a/components/Box/InformationBox.tsx b/components/Box/InformationBox.tsx index f9d2f9b..33f57f7 100644 --- a/components/Box/InformationBox.tsx +++ b/components/Box/InformationBox.tsx @@ -7,7 +7,7 @@ import BaseBox from "./BaseBox"; export default function InformationBox({ text }: { text: string }) { return ( <> - + + + + + + {title || + `Judul Dokumen: Lorem, ipsum dolor sit amet consectetur adipisicing elit.`} + + + {leftIcon && {leftIcon}} + + + + ); +}