diff --git a/app/(application)/(user)/_layout.tsx b/app/(application)/(user)/_layout.tsx index ff4bbaf..e8ed068 100644 --- a/app/(application)/(user)/_layout.tsx +++ b/app/(application)/(user)/_layout.tsx @@ -1,6 +1,7 @@ import { BackButton } from "@/components"; import LeftButtonCustom from "@/components/Button/BackButton"; import { MainColor } from "@/constants/color-palet"; +import { ICON_SIZE_SMALL } from "@/constants/constans-value"; import { HeaderStyles } from "@/styles/header-styles"; import { Ionicons } from "@expo/vector-icons"; import { router, Stack } from "expo-router"; @@ -147,7 +148,6 @@ export default function UserLayout() { }} /> - {/* ========== End Collaboration Section ========= */} {/* ========== Voting Section ========= */} @@ -182,6 +182,142 @@ export default function UserLayout() { {/* ========== End Voting Section ========= */} + {/* ========== Crowdfunding Section ========= */} + , + }} + /> + + {/* ========== End Crowdfunding Section ========= */} + + {/* ========== Investment Section ========= */} + , + }} + /> + , + }} + /> + , + }} + /> + , + }} + /> + + , + }} + /> + + , + }} + /> + , + }} + /> + , + }} + /> + + , + }} + /> + + , + }} + /> + + , + }} + /> + , + }} + /> + , + }} + /> + ( + router.navigate(`/investment/(tabs)/transaction`)} + /> + ), + }} + /> + + {/* ========== End Investment Section ========= */} + + {/* ========== Donation Section ========= */} + , + }} + /> + + {/* ========== End Donation Section ========= */} + {/* ========== Job Section ========= */} + + + + {listPage.map((item, index) => ( + + + + + + {item.title} + + {item.desc} + + + + + + + + ))} + + + ); +} diff --git a/app/(application)/(user)/donation/create.tsx b/app/(application)/(user)/donation/create.tsx new file mode 100644 index 0000000..d64cc5d --- /dev/null +++ b/app/(application)/(user)/donation/create.tsx @@ -0,0 +1,11 @@ +import { TextCustom, ViewWrapper } from "@/components"; + +export default function DonationCreate() { + return ( + + + Coming Soon ! + + + ); +} diff --git a/app/(application)/(user)/investment/(tabs)/_layout.tsx b/app/(application)/(user)/investment/(tabs)/_layout.tsx new file mode 100644 index 0000000..0e49df0 --- /dev/null +++ b/app/(application)/(user)/investment/(tabs)/_layout.tsx @@ -0,0 +1,59 @@ +import { ICON_SIZE_SMALL } from "@/constants/constans-value"; +import { TabsStyles } from "@/styles/tabs-styles"; +import { Feather, FontAwesome6, Ionicons } from "@expo/vector-icons"; +import { Tabs } from "expo-router"; + +export default function InvestmentTabsLayout() { + return ( + + ( + + ), + }} + /> + ( + + ), + }} + /> + ( + + ), + }} + /> + ( + + ), + }} + /> + + ); +} diff --git a/app/(application)/(user)/investment/(tabs)/index.tsx b/app/(application)/(user)/investment/(tabs)/index.tsx new file mode 100644 index 0000000..8c36335 --- /dev/null +++ b/app/(application)/(user)/investment/(tabs)/index.tsx @@ -0,0 +1,81 @@ +import { + BaseBox, + FloatingButton, + Grid, + ProgressCustom, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import DUMMY_IMAGE from "@/constants/dummy-image-value"; +import dayjs from "dayjs"; +import { Image } from "expo-image"; +import { router } from "expo-router"; +import { View } from "react-native"; + +export default function InvestmentBursa() { + return ( + router.push("/investment/create")} /> + } + > + {Array.from({ length: 10 }).map((_, index) => ( + + + + + + + + + + + + Title here : Lorem ipsum dolor sit amet consectetur + adipisicing elit. Omnis, exercitationem, sequi enim quod + distinctio maiores laudantium amet, quidem atque repellat sit + vitae qui aliquam est veritatis laborum eum voluptatum totam! + + + + Sisa waktu: {dayjs().diff(dayjs(), "day")} hari + + + + + + ))} + + ); +} + + +// +// Progress 70% +// + +// Success Progress +// + +// Warning Progress (small) +// + +// Error Indeterminate +// + +// Custom Radius +// + +// + +// + +// + +// +// ; \ No newline at end of file diff --git a/app/(application)/(user)/investment/(tabs)/my-holding.tsx b/app/(application)/(user)/investment/(tabs)/my-holding.tsx new file mode 100644 index 0000000..9433185 --- /dev/null +++ b/app/(application)/(user)/investment/(tabs)/my-holding.tsx @@ -0,0 +1,49 @@ +import { + BaseBox, + Grid, + ProgressCustom, + Spacing, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { View } from "react-native"; + +export default function InvestmentMyHolding() { + return ( + + {Array.from({ length: 10 }).map((_, index) => ( + + + + + + Title here : Lorem ipsum dolor sit amet consectetur + adipisicing elit. Omnis, exercitationem, sequi enim quod + distinctio maiores laudantium amet, quidem atque repellat sit + vitae qui aliquam est veritatis laborum eum voluptatum totam! + + + + Rp. 7.500.000 + 300 Lembar + + + + + + + + + + + ))} + + ); +} diff --git a/app/(application)/(user)/investment/(tabs)/portofolio.tsx b/app/(application)/(user)/investment/(tabs)/portofolio.tsx new file mode 100644 index 0000000..17e31e1 --- /dev/null +++ b/app/(application)/(user)/investment/(tabs)/portofolio.tsx @@ -0,0 +1,39 @@ +import { ScrollableCustom, ViewWrapper } from "@/components"; +import { masterStatus } from "@/lib/dummy-data/_master/status"; +import Investment_StatusBox from "@/screens/Invesment/StatusBox"; +import { useState } from "react"; + +export default function InvestmentPortofolio() { + const [activeCategory, setActiveCategory] = useState( + "publish" + ); + + const handlePress = (item: any) => { + setActiveCategory(item.value); + // tambahkan logika lain seperti filter dsb. + }; + + const scrollComponent = ( + ({ + id: i, + label: e.label, + value: e.value, + }))} + onButtonPress={handlePress} + activeId={activeCategory as any} + /> + ); + return ( + + {Array.from({ length: 10 }).map((_, index) => ( + + ))} + + ); +} diff --git a/app/(application)/(user)/investment/(tabs)/transaction.tsx b/app/(application)/(user)/investment/(tabs)/transaction.tsx new file mode 100644 index 0000000..c5688b9 --- /dev/null +++ b/app/(application)/(user)/investment/(tabs)/transaction.tsx @@ -0,0 +1,53 @@ +import { + BadgeCustom, + BaseBox, + Grid, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { GStyles } from "@/styles/global-styles"; +import dayjs from "dayjs"; +import { View } from "react-native"; + +export default function InvestmentTransaction() { + return ( + + {Array.from({ length: 10 }).map((_, i) => ( + + + + + + Title Investment: Lorem ipsum dolor sit amet consectetur + adipisicing elit. Am culpa excepturi deleniti soluta animi + porro amet ducimus. + + + {dayjs().format("DD/MM/YYYY")} + + + + + + + + + + Rp. 7.500.000 + + + Berhasil + + + + + + ))} + + ); +} diff --git a/app/(application)/(user)/investment/[id]/(document)/add-document.tsx b/app/(application)/(user)/investment/[id]/(document)/add-document.tsx new file mode 100644 index 0000000..cf92f61 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(document)/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]/(document)/edit-document.tsx b/app/(application)/(user)/investment/[id]/(document)/edit-document.tsx new file mode 100644 index 0000000..86e1136 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(document)/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]/(document)/list-of-document.tsx b/app/(application)/(user)/investment/[id]/(document)/list-of-document.tsx new file mode 100644 index 0000000..0372189 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(document)/list-of-document.tsx @@ -0,0 +1,16 @@ +import { ViewWrapper } from "@/components"; +import Investment_BoxDetailDocument from "@/screens/Invesment/Document/RecapBoxDetail"; + +export default function InvestmentListOfDocument() { + return ( + + {Array.from({ length: 10 }).map((_, index) => ( + + ))} + + ); +} diff --git a/app/(application)/(user)/investment/[id]/(document)/recap-of-document.tsx b/app/(application)/(user)/investment/[id]/(document)/recap-of-document.tsx new file mode 100644 index 0000000..0c7c2c2 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(document)/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}/(document)/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}/(document)/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/app/(application)/(user)/investment/[id]/(news)/[news]/index.tsx b/app/(application)/(user)/investment/[id]/(news)/[news]/index.tsx new file mode 100644 index 0000000..9656df9 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(news)/[news]/index.tsx @@ -0,0 +1,76 @@ +import { + AlertDefaultSystem, + BackButton, + BaseBox, + DotButton, + DrawerCustom, + DummyLandscapeImage, + MenuDrawerDynamicGrid, + StackCustom, + TextCustom, + ViewWrapper +} from "@/components"; +import { IconTrash } from "@/components/_Icon/IconTrash"; +import { router, Stack, useLocalSearchParams } from "expo-router"; +import { useState } from "react"; + +export default function InvestmentNews() { + const { id, news } = useLocalSearchParams(); + const [openDrawer, setOpenDrawer] = useState(false); + return ( + <> + , + headerRight: () => setOpenDrawer(true)} />, + }} + /> + + + + + + Judul Berita {news} Terbaru + + + Lorem ipsum dolor sit amet consectetur adipisicing elit. Laborum + fuga mollitia laboriosam voluptatibus quos molestias, illo fugiat + esse repellat, ad officia earum numquam? Aliquid corrupti quam + tempora cum harum est! + + + + + + setOpenDrawer(false)} + height={"auto"} + > + , + color: "red", + }, + ]} + onPressItem={(item) => { + AlertDefaultSystem({ + title: "Hapus Berita", + message: "Apakah Anda yakin ingin menghapus berita ini?", + textLeft: "Batal", + textRight: "Hapus", + onPressRight: () => { + router.back(); + setOpenDrawer(false); + }, + }); + }} + /> + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/(news)/add-news.tsx b/app/(application)/(user)/investment/[id]/(news)/add-news.tsx new file mode 100644 index 0000000..1046f89 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(news)/add-news.tsx @@ -0,0 +1,53 @@ +import { + ButtonCenteredOnly, + ButtonCustom, + InformationBox, + LandscapeFrameUploaded, + Spacing, + StackCustom, + TextAreaCustom, + TextInputCustom, + ViewWrapper, +} from "@/components"; +import { router } from "expo-router"; + +export default function InvestmentAddNews() { + return ( + + + + + { + router.push("/(application)/(image)/take-picture/123"); + }} + icon="upload" + > + Upload + + + + + + { + router.back(); + }} + > + Simpan + + + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/(news)/list-of-news.tsx b/app/(application)/(user)/investment/[id]/(news)/list-of-news.tsx new file mode 100644 index 0000000..aa0ddb8 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(news)/list-of-news.tsx @@ -0,0 +1,58 @@ +import { + BackButton, + BaseBox, + DrawerCustom, + MenuDrawerDynamicGrid, + TextCustom, + ViewWrapper +} from "@/components"; +import { IconPlus } from "@/components/_Icon"; +import { router, Stack, useLocalSearchParams } from "expo-router"; +import { useState } from "react"; + +export default function InvestmentListOfNews() { + const { id } = useLocalSearchParams(); + const [openDrawer, setOpenDrawer] = useState(false); + return ( + <> + , + // headerRight: () => setOpenDrawer(true)} />, + }} + /> + + {Array.from({ length: 15 }).map((_, index) => ( + + Berita Terbaru {index + 1} + + ))} + + + setOpenDrawer(false)} + height={"auto"} + > + , + }, + ]} + onPressItem={(item) => { + router.push(item.path as any); + setOpenDrawer(false); + }} + /> + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/(news)/recap-of-news.tsx b/app/(application)/(user)/investment/[id]/(news)/recap-of-news.tsx new file mode 100644 index 0000000..da4db88 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(news)/recap-of-news.tsx @@ -0,0 +1,59 @@ +import { + BackButton, + BaseBox, + DotButton, + DrawerCustom, + MenuDrawerDynamicGrid, + TextCustom, + ViewWrapper, +} from "@/components"; +import { IconPlus } from "@/components/_Icon"; +import { router, Stack, useLocalSearchParams } from "expo-router"; +import { useState } from "react"; + +export default function InvestmentRecapOfNews() { + const { id } = useLocalSearchParams(); + const [openDrawer, setOpenDrawer] = useState(false); + return ( + <> + , + headerRight: () => setOpenDrawer(true)} />, + }} + /> + + {Array.from({ length: 15 }).map((_, index) => ( + + Berita Terbaru {index + 1} + + ))} + + + setOpenDrawer(false)} + height={"auto"} + > + , + }, + ]} + onPressItem={(item) => { + router.push(item.path as any); + setOpenDrawer(false); + }} + /> + + + ); +} 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..2629e99 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/index.tsx @@ -0,0 +1,89 @@ +import { + BaseBox, + BoxButtonOnFooter, + ButtonCustom, + Divider, + Grid, + StackCustom, + TextCustom, + TextInputCustom, + ViewWrapper, +} from "@/components"; +import { router, useLocalSearchParams } from "expo-router"; + +export default function InvestmentInvest() { + const { id } = useLocalSearchParams(); + + const buttonSubmit = () => { + return ( + <> + + router.push(`/investment/${id}/select-bank`)}>Beli + + + ); + }; + + return ( + <> + + + + + + Sisa Lembar Saham + + + 3.000 + + + + + Harga Per Lembar + + + Rp. 1.000 + + + + + Jumlah Pembelian + + Minimum 10 lembar + + + + + + + + + + Total Harga + + + Rp. 1.000 + + + + + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/(transaction-flow)/invoice.tsx b/app/(application)/(user)/investment/[id]/(transaction-flow)/invoice.tsx new file mode 100644 index 0000000..ce773d5 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/invoice.tsx @@ -0,0 +1,103 @@ +import { + BaseBox, + ButtonCenteredOnly, + ButtonCustom, + Grid, + InformationBox, + Spacing, + StackCustom, + TextCustom, + ViewWrapper +} from "@/components"; +import { MainColor } from "@/constants/color-palet"; +import { router, useLocalSearchParams } from "expo-router"; + +export default function InvestmentInvoice() { + const { id } = useLocalSearchParams(); + return ( + <> + + + + + + Nama BANK + Nama Penerima + + + + + + + 4567898765433567 + + + + Salin + + + + + + + + + Jumlah Transaksi + + + + + + + + Rp. 1.000.000 + + + + Salin + + + + + + + + + Upload bukti transfer anda. + { + router.push("/(application)/(image)/take-picture/123") + }} icon="upload"> + Upload + + + + + { + router.push(`/investment/${id}/(transaction-flow)/process`) + + }}>Saya Sudah Transfer + + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/(transaction-flow)/process.tsx b/app/(application)/(user)/investment/[id]/(transaction-flow)/process.tsx new file mode 100644 index 0000000..c2d8653 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/process.tsx @@ -0,0 +1,13 @@ +import { BaseBox, TextCustom, ViewWrapper } from "@/components"; + +export default function InvestmentProcess() { + return ( + <> + + + Menunggu Konfirmasi Admin + + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/(transaction-flow)/select-bank.tsx b/app/(application)/(user)/investment/[id]/(transaction-flow)/select-bank.tsx new file mode 100644 index 0000000..4111083 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/select-bank.tsx @@ -0,0 +1,35 @@ +import { BaseBox, BoxButtonOnFooter, ButtonCustom, ViewWrapper } from "@/components"; +import { RadioCustom, RadioGroup } from "@/components/Radio/RadioCustom"; +import { dummyMasterBank } from "@/lib/dummy-data/_master/bank"; +import { router, useLocalSearchParams } from "expo-router"; +import { useState } from "react"; + +export default function InvestmentSelectBank() { + const { id } = useLocalSearchParams(); + const [value, setValue] = useState(""); + + const buttonSubmit = () => { + return ( + <> + + router.push(`/investment/${id}/invoice`)} + > + Pilih + + + + ); + }; + return ( + + + {dummyMasterBank.map((item) => ( + + + + ))} + + + ); +} 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 new file mode 100644 index 0000000..032e814 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/[status]/detail.tsx @@ -0,0 +1,136 @@ +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 InvestmentDetailStatus() { + 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}/(document)/recap-of-document`, + }, + ]} + columns={4} + onPressItem={handlePressDraft as any} + /> + + + {/* ========= Publish Drawer ========= */} + setOpenDrawerPublish(false)} + height={"auto"} + > + , + label: "Update Dokumen", + path: `/investment/${id}/(document)/recap-of-document`, + }, + { + icon: , + label: "Update Berita", + path: `/investment/${id}/(news)/recap-of-news`, + }, + ]} + onPressItem={handlePressPublish as any} + /> + + + ); +} 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 new file mode 100644 index 0000000..0008f97 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/edit.tsx @@ -0,0 +1,164 @@ +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 ( + + + + + 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]/index.tsx b/app/(application)/(user)/investment/[id]/index.tsx new file mode 100644 index 0000000..e766f5b --- /dev/null +++ b/app/(application)/(user)/investment/[id]/index.tsx @@ -0,0 +1,134 @@ +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() { + 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/app/(application)/(user)/investment/[id]/investor.tsx b/app/(application)/(user)/investment/[id]/investor.tsx new file mode 100644 index 0000000..703d954 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/investor.tsx @@ -0,0 +1,21 @@ +import { + AvatarUsernameAndOtherComponent, + BoxWithHeaderSection, + TextCustom, + ViewWrapper, +} from "@/components"; + +export default function InvestmentInvestor() { + return ( + <> + + {Array.from({ length: 10 }).map((_, index) => ( + + + Rp. 7.000.000 + + ))} + + + ); +} diff --git a/app/(application)/(user)/investment/create.tsx b/app/(application)/(user)/investment/create.tsx new file mode 100644 index 0000000..c9450cc --- /dev/null +++ b/app/(application)/(user)/investment/create.tsx @@ -0,0 +1,197 @@ +import { + BaseBox, + ButtonCenteredOnly, + ButtonCustom, + CenterCustom, + InformationBox, + LandscapeFrameUploaded, + SelectCustom, + Spacing, + StackCustom, + TextInputCustom, + ViewWrapper, +} from "@/components"; +import { MainColor } from "@/constants/color-palet"; +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 { FontAwesome5 } from "@expo/vector-icons"; +import { router } from "expo-router"; +import { useState } from "react"; + +export default function InvestmentCreate() { + const [data, setData] = useState({ + title: "", + targetDana: 0, + hargaPerLembar: 0, + totalLembar: 0, + rasioKeuntungan: 0, + pencarianInvestor: "", + periodeDeviden: "", + pembagianDeviden: "", + }); + +// const [coba, setCoba] = useState(""); + return ( + + + {/* + setCoba(value)} + value={coba} + keyboardType="decimal-pad" + /> + */} + + + + router.push("/take-picture/1")} + > + Upload + + + + + + + + + + + + router.push("/take-picture/1")} + > + Upload File + + + + 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)/coba/index.tsx b/app/(application)/coba/index.tsx index 65e2c9e..3731644 100644 --- a/app/(application)/coba/index.tsx +++ b/app/(application)/coba/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import React from "react"; import { View, @@ -11,6 +12,8 @@ import { Ionicons } from "@expo/vector-icons"; import { router, Stack } from "expo-router"; import EventDetailScreen from "./double-scroll"; import LeftButtonCustom from "@/components/Button/BackButton"; +import CustomUploadButton from "./upload-button"; +import { SafeAreaView } from "react-native-safe-area-context"; const { width } = Dimensions.get("window"); @@ -117,14 +120,38 @@ const CustomTabNavigator = () => { const ActiveComponent = getActiveComponent(); + const handleImageUpload = (file: any) => { + console.log("Gambar dipilih:", file); + // Upload ke server + }; + + const handlePdfOrPngUpload = (file: any) => { + console.log("PDF atau PNG dipilih:", file); + }; + return ( <> - - + + + + + + + {/* Hanya PDF atau PNG */} + + // // {/* Content Area */} diff --git a/app/(application)/coba/upload-button.tsx b/app/(application)/coba/upload-button.tsx new file mode 100644 index 0000000..494d014 --- /dev/null +++ b/app/(application)/coba/upload-button.tsx @@ -0,0 +1,99 @@ +// components/CustomUploadButton.tsx +import React from 'react'; +import { Button, Alert, View, StyleSheet } from 'react-native'; +import * as DocumentPicker from 'expo-document-picker'; +import { isValidFileType, getMimeType } from '../../../utils/fileValidation'; + +interface UploadButtonProps { + allowedExtensions: string[]; + buttonTitle?: string; + onFileSelected?: (file: { + uri: string; + name: string; + size: number | null; + mimeType: string; + }) => void; +} + +const CustomUploadButton: React.FC = ({ + allowedExtensions, + buttonTitle = 'Pilih File', + onFileSelected, +}) => { + const handlePickFile = async () => { + try { + // Coba filter dengan MIME type jika memungkinkan + const typeFilter = getMimeTypeFilter(allowedExtensions); + + const result = await DocumentPicker.getDocumentAsync({ + type: typeFilter, // Ini membantu memfilter di UI pemilih + copyToCacheDirectory: true, + }); + + if (result.canceled) { + Alert.alert('Dibatalkan', 'Tidak ada file yang dipilih.'); + return; + } + + const file = result.assets[0]; + const { uri, name, size } = file; + + // Validasi ekstensi secara manual (cadangan jika MIME tidak akurat) + if (!isValidFileType(name, allowedExtensions)) { + Alert.alert( + 'Format Tidak Didukung', + `Hanya file dengan ekstensi berikut yang diperbolehkan: ${allowedExtensions.join(', ')}` + ); + return; + } + + const mimeType = getMimeType(name); + + // Kirim data file ke komponen induk + if (onFileSelected) { + onFileSelected({ uri, name, size: size || null, mimeType }); + } + + Alert.alert('Berhasil', `File ${name} berhasil dipilih!`); + } catch (error) { + console.error('Error picking file:', error); + Alert.alert('Error', 'Terjadi kesalahan saat memilih file.'); + } + }; + + return ( + +