From 16462c42149f3123ba679659ddeeff2bbd85bf5c Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Fri, 1 Aug 2025 11:35:39 +0800 Subject: [PATCH 1/4] Invesment Add - _master/status-transaction.ts - investment/[id]/(transaction-flow)/success.tsx - investment/[id]/(transaction-flow)/failed.tsx Fix: - lib/dummy-data/_master/status.tsx Component: - components/Badge/BadgeCustom.tsx: Penambahan custom color ## No Issue --- app/(application)/(user)/_layout.tsx | 29 ++++++- .../(user)/event/(tabs)/status.tsx | 14 ++-- .../(user)/investment/(tabs)/portofolio.tsx | 4 +- .../(user)/investment/(tabs)/transaction.tsx | 36 +++++++- .../[id]/(transaction-flow)/failed.tsx | 79 +++++++++++++++++ .../[id]/(transaction-flow)/invoice.tsx | 41 +++++---- .../[id]/(transaction-flow)/process.tsx | 36 +++++++- .../[id]/(transaction-flow)/select-bank.tsx | 9 +- .../[id]/(transaction-flow)/success.tsx | 84 +++++++++++++++++++ .../(user)/job/(tabs)/status.tsx | 12 +-- .../(user)/voting/(tabs)/status.tsx | 4 +- components/Badge/BadgeCustom.tsx | 8 +- lib/dummy-data/_master/status-transaction.ts | 8 ++ lib/dummy-data/_master/status.tsx | 2 +- 14 files changed, 317 insertions(+), 49 deletions(-) create mode 100644 app/(application)/(user)/investment/[id]/(transaction-flow)/failed.tsx create mode 100644 app/(application)/(user)/investment/[id]/(transaction-flow)/success.tsx create mode 100644 lib/dummy-data/_master/status-transaction.ts diff --git a/app/(application)/(user)/_layout.tsx b/app/(application)/(user)/_layout.tsx index e8ed068..5a5a328 100644 --- a/app/(application)/(user)/_layout.tsx +++ b/app/(application)/(user)/_layout.tsx @@ -287,7 +287,16 @@ export default function UserLayout() { name="investment/[id]/(transaction-flow)/invoice" options={{ title: "Invoice", - headerLeft: () => , + headerLeft: () => ( + + router.navigate(`/investment/(tabs)/transaction`) + } + /> + ), }} /> router.navigate(`/investment/(tabs)/transaction`)} + onPress={() => + router.navigate(`/investment/(tabs)/transaction`) + } /> ), }} /> + , + }} + /> + , + }} + /> {/* ========== End Investment Section ========= */} diff --git a/app/(application)/(user)/event/(tabs)/status.tsx b/app/(application)/(user)/event/(tabs)/status.tsx index 86cccc5..1605185 100644 --- a/app/(application)/(user)/event/(tabs)/status.tsx +++ b/app/(application)/(user)/event/(tabs)/status.tsx @@ -1,12 +1,12 @@ import { - BoxWithHeaderSection, - Grid, - ScrollableCustom, - StackCustom, - TextCustom + BoxWithHeaderSection, + Grid, + ScrollableCustom, + StackCustom, + TextCustom } from "@/components"; import ViewWrapper from "@/components/_ShareComponent/ViewWrapper"; -import { masterStatus } from "@/lib/dummy-data/_master/status"; +import { dummyMasterStatus } from "@/lib/dummy-data/_master/status"; import { useState } from "react"; export default function EventStatus() { @@ -23,7 +23,7 @@ export default function EventStatus() { const scrollComponent = ( ({ + data={dummyMasterStatus.map((e, i) => ({ id: i, label: e.label, value: e.value, diff --git a/app/(application)/(user)/investment/(tabs)/portofolio.tsx b/app/(application)/(user)/investment/(tabs)/portofolio.tsx index 17e31e1..32c2aa3 100644 --- a/app/(application)/(user)/investment/(tabs)/portofolio.tsx +++ b/app/(application)/(user)/investment/(tabs)/portofolio.tsx @@ -1,5 +1,5 @@ import { ScrollableCustom, ViewWrapper } from "@/components"; -import { masterStatus } from "@/lib/dummy-data/_master/status"; +import { dummyMasterStatus } from "@/lib/dummy-data/_master/status"; import Investment_StatusBox from "@/screens/Invesment/StatusBox"; import { useState } from "react"; @@ -15,7 +15,7 @@ export default function InvestmentPortofolio() { const scrollComponent = ( ({ + data={dummyMasterStatus.map((e, i) => ({ id: i, label: e.label, value: e.value, diff --git a/app/(application)/(user)/investment/(tabs)/transaction.tsx b/app/(application)/(user)/investment/(tabs)/transaction.tsx index c5688b9..bf8d5ac 100644 --- a/app/(application)/(user)/investment/(tabs)/transaction.tsx +++ b/app/(application)/(user)/investment/(tabs)/transaction.tsx @@ -6,15 +6,43 @@ import { TextCustom, ViewWrapper, } from "@/components"; +import { dummyMasterStatusTransaction } from "@/lib/dummy-data/_master/status-transaction"; import { GStyles } from "@/styles/global-styles"; import dayjs from "dayjs"; +import { router } from "expo-router"; import { View } from "react-native"; export default function InvestmentTransaction() { + const randomStatusData = Array.from({ length: 10 }, () => { + const randomIndex = Math.floor( + Math.random() * dummyMasterStatusTransaction.length + ); + return dummyMasterStatusTransaction[randomIndex]; + }); + + const handlePress = (value: string) => { + if (value === "menunggu") { + router.push(`/investment/${value}/(transaction-flow)/invoice`); + } else if (value === "proses") { + router.push(`/investment/${value}/(transaction-flow)/process`); + } else if (value === "berhasil") { + router.push(`/investment/${value}/(transaction-flow)/success`); + } else if (value === "gagal") { + router.push(`/investment/${value}/(transaction-flow)/failed`); + } + }; + return ( - {Array.from({ length: 10 }).map((_, i) => ( - + {randomStatusData.map((item, i) => ( + { + handlePress(item.value); + }} + > @@ -38,10 +66,10 @@ export default function InvestmentTransaction() { - Berhasil + {item.label} diff --git a/app/(application)/(user)/investment/[id]/(transaction-flow)/failed.tsx b/app/(application)/(user)/investment/[id]/(transaction-flow)/failed.tsx new file mode 100644 index 0000000..9b10578 --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/failed.tsx @@ -0,0 +1,79 @@ +import { BaseBox, Grid, Spacing, StackCustom, TextCustom, ViewWrapper } from "@/components"; +import { MainColor } from "@/constants/color-palet"; +import { GStyles } from "@/styles/global-styles"; +import { FontAwesome6 } from "@expo/vector-icons"; + +export default function InvestmentFailed() { + return ( + + + + + + Transaksi anda gagal karena bukti transfer tidak sesuai dengan + data kami. Jika ini masalah khusus silahkan hubungi pada kontak + whatsapp kami. + + + + + + + + + Detail Transaksi + + + + + + {listData.map((item, i) => ( + + + {item.label} + + + + {item.value} + + + + ))} + + + + + ); +} + +const listData = [ + { + label: "Bank", + value: " BCA", + }, + { + label: "Rekening Penerima", + value: "Himpunan Pengusaha Muda Indonesia", + }, + { + label: "No Rekening", + value: "2304235678854332", + }, + { + label: "Jumlah", + value: "Rp. 1.000.000", + }, + { + label: "Tanggal", + value: "2022-01-01", + }, + { + label: "Lembar Terbeli", + value: "100", + }, +]; diff --git a/app/(application)/(user)/investment/[id]/(transaction-flow)/invoice.tsx b/app/(application)/(user)/investment/[id]/(transaction-flow)/invoice.tsx index ce773d5..6ce95c7 100644 --- a/app/(application)/(user)/investment/[id]/(transaction-flow)/invoice.tsx +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/invoice.tsx @@ -1,19 +1,19 @@ import { - BaseBox, - ButtonCenteredOnly, - ButtonCustom, - Grid, - InformationBox, - Spacing, - StackCustom, - TextCustom, - ViewWrapper + 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(); + const { id } = useLocalSearchParams(); return ( <> @@ -84,19 +84,26 @@ export default function InvestmentInvoice() { Upload bukti transfer anda. - { - router.push("/(application)/(image)/take-picture/123") - }} icon="upload"> + { + router.push("/(application)/(image)/take-picture/123"); + }} + icon="upload" + > Upload - { - router.push(`/investment/${id}/(transaction-flow)/process`) - - }}>Saya Sudah Transfer + { + 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 index c2d8653..eec7c2b 100644 --- a/app/(application)/(user)/investment/[id]/(transaction-flow)/process.tsx +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/process.tsx @@ -1,11 +1,43 @@ -import { BaseBox, TextCustom, ViewWrapper } from "@/components"; +import { + BaseBox, + Grid, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { MainColor } from "@/constants/color-palet"; +import { Ionicons } from "@expo/vector-icons"; +import { ActivityIndicator } from "react-native"; export default function InvestmentProcess() { return ( <> - Menunggu Konfirmasi Admin + + + Admin sedang memproses transaksimu + + + + + + + + + + Hubungi admin jika tidak kunjung di proses! Klik pada logo + Whatsapp ini. + + + + + + diff --git a/app/(application)/(user)/investment/[id]/(transaction-flow)/select-bank.tsx b/app/(application)/(user)/investment/[id]/(transaction-flow)/select-bank.tsx index 4111083..04c5863 100644 --- a/app/(application)/(user)/investment/[id]/(transaction-flow)/select-bank.tsx +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/select-bank.tsx @@ -1,4 +1,9 @@ -import { BaseBox, BoxButtonOnFooter, ButtonCustom, ViewWrapper } from "@/components"; +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"; @@ -13,7 +18,7 @@ export default function InvestmentSelectBank() { <> router.push(`/investment/${id}/invoice`)} + onPress={() => router.replace(`/investment/${id}/invoice`)} > Pilih diff --git a/app/(application)/(user)/investment/[id]/(transaction-flow)/success.tsx b/app/(application)/(user)/investment/[id]/(transaction-flow)/success.tsx new file mode 100644 index 0000000..a087ecb --- /dev/null +++ b/app/(application)/(user)/investment/[id]/(transaction-flow)/success.tsx @@ -0,0 +1,84 @@ +import { + BaseBox, + Grid, + Spacing, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { MainColor } from "@/constants/color-palet"; +import { GStyles } from "@/styles/global-styles"; +import { FontAwesome6 } from "@expo/vector-icons"; + +export default function InvestmentSuccess() { + return ( + + + + + + + + Terimakasih telah percaya pada kami untuk mengelola dana anda! + Info mengenai update Investasi ini bisa di lihat di kolom berita. + + + + + + + Detail Transaksi + + + + + + + {listData.map((item, i) => ( + + + {item.label} + + + {item.value} + + + ))} + + + + + ); +} + +const listData = [ + { + label: "Bank", + value: " BCA", + }, + { + label: "Rekening Penerima", + value: "Himpunan Pengusaha Muda Indonesia", + }, + { + label: "No Rekening", + value: "2304235678854332", + }, + { + label: "Jumlah", + value: "Rp. 1.000.000", + }, + { + label: "Tanggal", + value: "2022-01-01", + }, + { + label: "Lembar Terbeli", + value: "100", + }, +]; diff --git a/app/(application)/(user)/job/(tabs)/status.tsx b/app/(application)/(user)/job/(tabs)/status.tsx index 3b32962..e54f6cc 100644 --- a/app/(application)/(user)/job/(tabs)/status.tsx +++ b/app/(application)/(user)/job/(tabs)/status.tsx @@ -1,10 +1,10 @@ import { - BaseBox, - ScrollableCustom, - TextCustom, - ViewWrapper, + BaseBox, + ScrollableCustom, + TextCustom, + ViewWrapper, } from "@/components"; -import { masterStatus } from "@/lib/dummy-data/_master/status"; +import { dummyMasterStatus } from "@/lib/dummy-data/_master/status"; import { jobDataDummy } from "@/screens/Job/listDataDummy"; import { useState } from "react"; @@ -20,7 +20,7 @@ export default function JobStatus() { const scrollComponent = ( ({ + data={dummyMasterStatus.map((e, i) => ({ id: i, label: e.label, value: e.value, diff --git a/app/(application)/(user)/voting/(tabs)/status.tsx b/app/(application)/(user)/voting/(tabs)/status.tsx index 006dae6..01ad922 100644 --- a/app/(application)/(user)/voting/(tabs)/status.tsx +++ b/app/(application)/(user)/voting/(tabs)/status.tsx @@ -6,7 +6,7 @@ import { TextCustom, ViewWrapper, } from "@/components"; -import { masterStatus } from "@/lib/dummy-data/_master/status"; +import { dummyMasterStatus } from "@/lib/dummy-data/_master/status"; import dayjs from "dayjs"; import { useState } from "react"; @@ -22,7 +22,7 @@ export default function VotingStatus() { const scrollComponent = ( ({ + data={dummyMasterStatus.map((e, i) => ({ id: i, label: e.label, value: e.value, diff --git a/components/Badge/BadgeCustom.tsx b/components/Badge/BadgeCustom.tsx index eada0c7..7c65e63 100644 --- a/components/Badge/BadgeCustom.tsx +++ b/components/Badge/BadgeCustom.tsx @@ -21,7 +21,7 @@ type BadgeSize = "xs" | "sm" | "md" | "lg"; interface BadgeProps extends ViewProps { children: React.ReactNode; variant?: BadgeVariant; - color?: BadgeColor; + color?: BadgeColor | string; size?: BadgeSize; leftIcon?: React.ReactNode; rightIcon?: React.ReactNode; @@ -43,7 +43,8 @@ const BadgeCustom: React.FC = ({ style, ...props }) => { - const colors = { + // Daftar warna bawaan + const defaultColors = { primary: "#339AF0", success: "#40C057", warning: "#FAB005", @@ -52,8 +53,7 @@ const BadgeCustom: React.FC = ({ dark: "#212529", }; - const themeColor = colors[color]; - + const themeColor = color in defaultColors ? defaultColors[color as BadgeColor] : color; // Ganti bagian sizeStyles dan styles.container const sizeStyles = { xs: { diff --git a/lib/dummy-data/_master/status-transaction.ts b/lib/dummy-data/_master/status-transaction.ts new file mode 100644 index 0000000..36923f2 --- /dev/null +++ b/lib/dummy-data/_master/status-transaction.ts @@ -0,0 +1,8 @@ +import { AccentColor, MainColor } from "@/constants/color-palet"; + +export const dummyMasterStatusTransaction = [ + { value: "berhasil", label: "Berhasil", color: MainColor.green }, + { value: "proses", label: "Proses", color: AccentColor.skyblue }, + { value: "menunggu", label: "Menunggu", color: MainColor.yellow }, + { value: "gagal", label: "Gagal", color: MainColor.red }, +]; diff --git a/lib/dummy-data/_master/status.tsx b/lib/dummy-data/_master/status.tsx index e5f7068..6994397 100644 --- a/lib/dummy-data/_master/status.tsx +++ b/lib/dummy-data/_master/status.tsx @@ -1,4 +1,4 @@ -export const masterStatus = [ +export const dummyMasterStatus = [ { value: "publish", label: "Publish" }, { value: "review", label: "Review" }, { value: "draft", label: "Draft" }, From db0f4246b646efa22d4297fff2be96075891bba1 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Fri, 1 Aug 2025 12:01:40 +0800 Subject: [PATCH 2/4] Invesment Add: - /investment/[id]/(my-holding)/ Fix: - screens/Invesment/DetailDataPublishSection.tsx: tipe data prop ? ## No Issue --- app/(application)/(user)/_layout.tsx | 7 + .../(user)/investment/(tabs)/my-holding.tsx | 3 +- .../investment/[id]/(my-holding)/[id].tsx | 154 ++++++++++++++++++ .../Invesment/DetailDataPublishSection.tsx | 4 +- 4 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 app/(application)/(user)/investment/[id]/(my-holding)/[id].tsx 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 ( <> From 0eebe646478634fdb4ce8540a53b90e0b248f509 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Fri, 1 Aug 2025 15:09:20 +0800 Subject: [PATCH 3/4] Invesment Fix: - ComponentBoxOnBottomDetail: file route > /(file)/[id].tsx Feature: - app/(application)/(file)/ ## No Issue --- app/(application)/(file)/[id].tsx | 25 +++++++++++++++++++ .../[id]/(document)/list-of-document.tsx | 2 +- .../[id]/(document)/recap-of-document.tsx | 2 +- .../(user)/investment/[id]/[file]/file.tsx | 20 --------------- .../Invesment/ComponentBoxOnBottomDetail.tsx | 4 +-- 5 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 app/(application)/(file)/[id].tsx delete mode 100644 app/(application)/(user)/investment/[id]/[file]/file.tsx diff --git a/app/(application)/(file)/[id].tsx b/app/(application)/(file)/[id].tsx new file mode 100644 index 0000000..e39b618 --- /dev/null +++ b/app/(application)/(file)/[id].tsx @@ -0,0 +1,25 @@ +import { BackButton, ViewWrapper } from "@/components"; +import { MainColor } from "@/constants/color-palet"; +import { FontAwesome } from "@expo/vector-icons"; +import { Stack } from "expo-router"; + +export default function FileScreen() { + return ( + <> + , + }} + /> + + + + + ); +} diff --git a/app/(application)/(user)/investment/[id]/(document)/list-of-document.tsx b/app/(application)/(user)/investment/[id]/(document)/list-of-document.tsx index 0372189..0c4ead4 100644 --- a/app/(application)/(user)/investment/[id]/(document)/list-of-document.tsx +++ b/app/(application)/(user)/investment/[id]/(document)/list-of-document.tsx @@ -8,7 +8,7 @@ export default function InvestmentListOfDocument() { ))} diff --git a/app/(application)/(user)/investment/[id]/(document)/recap-of-document.tsx b/app/(application)/(user)/investment/[id]/(document)/recap-of-document.tsx index 0c7c2c2..1405c34 100644 --- a/app/(application)/(user)/investment/[id]/(document)/recap-of-document.tsx +++ b/app/(application)/(user)/investment/[id]/(document)/recap-of-document.tsx @@ -53,7 +53,7 @@ export default function InvestmentRecapOfDocument() { onPress={() => setOpenDrawerBox(true)} /> } - href={`/investment/${id}/dokumen/file`} + href={`/(file)/${id}`} /> ))} diff --git a/app/(application)/(user)/investment/[id]/[file]/file.tsx b/app/(application)/(user)/investment/[id]/[file]/file.tsx deleted file mode 100644 index 89cfab9..0000000 --- a/app/(application)/(user)/investment/[id]/[file]/file.tsx +++ /dev/null @@ -1,20 +0,0 @@ -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/screens/Invesment/ComponentBoxOnBottomDetail.tsx b/screens/Invesment/ComponentBoxOnBottomDetail.tsx index eac8686..5ad938e 100644 --- a/screens/Invesment/ComponentBoxOnBottomDetail.tsx +++ b/screens/Invesment/ComponentBoxOnBottomDetail.tsx @@ -25,7 +25,7 @@ export default function Invesment_ComponentBoxOnBottomDetail({ Prospektus @@ -94,7 +94,7 @@ export default function Invesment_ComponentBoxOnBottomDetail({ Prospektus From 25e495cdf139f8996cadcc0365b513a0c6fb397b Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Fri, 1 Aug 2025 17:32:05 +0800 Subject: [PATCH 4/4] Donation Add: - lib/dummy-data/donasi - donation/(tabs)/ - donation/create-story.tsx Fix: - app/(application)/(user)/_layout.tsx - app/(application)/(user)/crowdfunding/index.tsx - app/(application)/(user)/donation/create.tsx - screens/Authentication/LoginView.tsx ## No Issue --- app/(application)/(user)/_layout.tsx | 16 +++- .../(user)/crowdfunding/index.tsx | 2 +- .../(user)/donation/(tabs)/_layout.tsx | 37 ++++++++++ .../(user)/donation/(tabs)/index.tsx | 56 ++++++++++++++ .../(user)/donation/(tabs)/my-donation.tsx | 60 +++++++++++++++ .../(user)/donation/(tabs)/status.tsx | 74 +++++++++++++++++++ .../(user)/donation/create-story.tsx | 64 ++++++++++++++++ app/(application)/(user)/donation/create.tsx | 67 ++++++++++++++++- .../_ShareComponent/DummyLandscapeImage.tsx | 5 +- lib/dummy-data/donasi/durasi.tsx | 18 +++++ lib/dummy-data/donasi/kategori.tsx | 22 ++++++ screens/Authentication/LoginView.tsx | 3 +- 12 files changed, 414 insertions(+), 10 deletions(-) create mode 100644 app/(application)/(user)/donation/(tabs)/_layout.tsx create mode 100644 app/(application)/(user)/donation/(tabs)/index.tsx create mode 100644 app/(application)/(user)/donation/(tabs)/my-donation.tsx create mode 100644 app/(application)/(user)/donation/(tabs)/status.tsx create mode 100644 app/(application)/(user)/donation/create-story.tsx create mode 100644 lib/dummy-data/donasi/durasi.tsx create mode 100644 lib/dummy-data/donasi/kategori.tsx diff --git a/app/(application)/(user)/_layout.tsx b/app/(application)/(user)/_layout.tsx index e32b193..1f557d5 100644 --- a/app/(application)/(user)/_layout.tsx +++ b/app/(application)/(user)/_layout.tsx @@ -340,6 +340,14 @@ export default function UserLayout() { {/* ========== End Investment Section ========= */} {/* ========== Donation Section ========= */} + , + }} + /> + , }} /> - + , + }} + /> {/* ========== End Donation Section ========= */} {/* ========== Job Section ========= */} diff --git a/app/(application)/(user)/crowdfunding/index.tsx b/app/(application)/(user)/crowdfunding/index.tsx index 30f58dc..0a5a76a 100644 --- a/app/(application)/(user)/crowdfunding/index.tsx +++ b/app/(application)/(user)/crowdfunding/index.tsx @@ -20,7 +20,7 @@ export default function Crowdfunding() { { title: "Donasi", desc: "Berbagi info untuk berdonasi lebih luas dan lebih efisien.", - path: "donation/create", + path: "donation/(tabs)", }, ]; diff --git a/app/(application)/(user)/donation/(tabs)/_layout.tsx b/app/(application)/(user)/donation/(tabs)/_layout.tsx new file mode 100644 index 0000000..0c4f12f --- /dev/null +++ b/app/(application)/(user)/donation/(tabs)/_layout.tsx @@ -0,0 +1,37 @@ +import { IconHome, IconStatus } from "@/components/_Icon"; +import { ICON_SIZE_SMALL } from "@/constants/constans-value"; +import { TabsStyles } from "@/styles/tabs-styles"; +import { + FontAwesome5 +} from "@expo/vector-icons"; +import { Tabs } from "expo-router"; + +export default function InvestmentTabsLayout() { + return ( + + , + }} + /> + , + }} + /> + ( + + ), + }} + /> + + ); +} diff --git a/app/(application)/(user)/donation/(tabs)/index.tsx b/app/(application)/(user)/donation/(tabs)/index.tsx new file mode 100644 index 0000000..3f0709a --- /dev/null +++ b/app/(application)/(user)/donation/(tabs)/index.tsx @@ -0,0 +1,56 @@ +import { + BaseBox, + DummyLandscapeImage, + FloatingButton, + Grid, + ProgressCustom, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { router } from "expo-router"; +import { View } from "react-native"; + +export default function DonationBeranda() { + return ( + router.push("/donation/create")} /> + } + > + {Array.from({ length: 10 }).map((_, index) => ( + + + + + + + + + + + + + Judul Donasi: Lorem ipsum dolor sit amet consectetur + adipisicing elit. + + Sisa hari: 0 + + + {/* + Terkumpul : Rp 300.000 + */} + + + + + ))} + + ); +} diff --git a/app/(application)/(user)/donation/(tabs)/my-donation.tsx b/app/(application)/(user)/donation/(tabs)/my-donation.tsx new file mode 100644 index 0000000..e9a71df --- /dev/null +++ b/app/(application)/(user)/donation/(tabs)/my-donation.tsx @@ -0,0 +1,60 @@ +import { + BadgeCustom, + BaseBox, + DummyLandscapeImage, + Grid, + StackCustom, + TextCustom, + ViewWrapper +} from "@/components"; +import { dummyMasterStatusTransaction } from "@/lib/dummy-data/_master/status-transaction"; +import { View } from "react-native"; + +export default function DonationMyDonation() { + const randomStatusData = Array.from({ length: 10 }, () => { + const randomIndex = Math.floor( + Math.random() * dummyMasterStatusTransaction.length + ); + return dummyMasterStatusTransaction[randomIndex]; + }); + return ( + + {randomStatusData.map((item, index) => ( + + + + + + + + + + + + + Judul Donasi: Lorem ipsum dolor sit amet consectetur + adipisicing elit. + + + + Donasi Saya + + Rp. 7.500.000 + + + + {item.label} + + + + + + ))} + + ); +} diff --git a/app/(application)/(user)/donation/(tabs)/status.tsx b/app/(application)/(user)/donation/(tabs)/status.tsx new file mode 100644 index 0000000..7fd35ad --- /dev/null +++ b/app/(application)/(user)/donation/(tabs)/status.tsx @@ -0,0 +1,74 @@ +import { + Grid, + BaseBox, + DummyLandscapeImage, + ScrollableCustom, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { dummyMasterStatus } from "@/lib/dummy-data/_master/status"; +import { useState } from "react"; +import { View } from "react-native"; + +export default function DonationStatus() { + 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) => ( + + + + + + + + + + + + Judul Donasi: {activeCategory} Lorem ipsum dolor sit amet + consectetur adipisicing elit. + + + + Target Dana + + Rp. 7.500.000 + + + {/* + Terkumpul : Rp 300.000 + */} + + + + + ))} + + ); +} diff --git a/app/(application)/(user)/donation/create-story.tsx b/app/(application)/(user)/donation/create-story.tsx new file mode 100644 index 0000000..ffc7d6d --- /dev/null +++ b/app/(application)/(user)/donation/create-story.tsx @@ -0,0 +1,64 @@ +import { + ButtonCenteredOnly, + ButtonCustom, + InformationBox, + LandscapeFrameUploaded, + Spacing, + StackCustom, + TextAreaCustom, + TextInputCustom, + ViewWrapper, +} from "@/components"; +import { router } from "expo-router"; + +export default function DonationCreateStory() { + return ( + + + + + + + + {}} icon="upload"> + Upload + + + + + + + + + { + router.navigate(`/donation/(tabs)/status`); + }} + > + Simpan + + + + + ); +} diff --git a/app/(application)/(user)/donation/create.tsx b/app/(application)/(user)/donation/create.tsx index d64cc5d..98f95d7 100644 --- a/app/(application)/(user)/donation/create.tsx +++ b/app/(application)/(user)/donation/create.tsx @@ -1,11 +1,70 @@ -import { TextCustom, ViewWrapper } from "@/components"; +import { + ButtonCenteredOnly, + ButtonCustom, + InformationBox, + LandscapeFrameUploaded, + SelectCustom, + Spacing, + StackCustom, + TextInputCustom, + ViewWrapper +} from "@/components"; +import { dummyDonasiDurasi } from "@/lib/dummy-data/donasi/durasi"; +import { dummyDonasiKategori } from "@/lib/dummy-data/donasi/kategori"; +import { router } from "expo-router"; export default function DonationCreate() { return ( - - Coming Soon ! - + + + + + + + ({ + label: item.label, + value: item.value, + }))} + onChange={(value) => console.log(value)} + label="Pilih Kategori Donasi" + placeholder="Pilih Kategori Donasi" + required + /> + + ({ + label: item.label, + value: item.value, + }))} + onChange={(value) => console.log(value)} + label="Pilih Durasi Donasi" + placeholder="Pilih Durasi Donasi" + required + /> + + + { + router.push("/(application)/(image)/take-picture/123") + }} icon="upload"> + Upload + + + { + router.push("/donation/create-story") + }}>Selanjutnya + + ); } diff --git a/components/_ShareComponent/DummyLandscapeImage.tsx b/components/_ShareComponent/DummyLandscapeImage.tsx index b5db5c8..6a5cc38 100644 --- a/components/_ShareComponent/DummyLandscapeImage.tsx +++ b/components/_ShareComponent/DummyLandscapeImage.tsx @@ -5,14 +5,14 @@ import { StyleSheet } from "react-native"; import ClickableCustom from "../Clickable/ClickableCustom"; import { router } from "expo-router"; -export default function DummyLandscapeImage() { +export default function DummyLandscapeImage({height}: {height?: number}) { return ( { router.push("/(application)/(image)/preview-image/1"); }} > - + ); } @@ -20,7 +20,6 @@ export default function DummyLandscapeImage() { const styles = StyleSheet.create({ backgroundImage: { width: "100%", - height: 200, // Tinggi background sesuai kebutuhan justifyContent: "center", alignItems: "center", borderRadius: 6, diff --git a/lib/dummy-data/donasi/durasi.tsx b/lib/dummy-data/donasi/durasi.tsx new file mode 100644 index 0000000..3121361 --- /dev/null +++ b/lib/dummy-data/donasi/durasi.tsx @@ -0,0 +1,18 @@ +export const dummyDonasiDurasi = [ + { + label: "1 Bulan", + value: "1_bulan", + }, + { + label: "3 Bulan", + value: "3_bulan", + }, + { + label: "6 Bulan", + value: "6_bulan", + }, + { + label: "1 Tahun", + value: "1_tahun", + }, +]; \ No newline at end of file diff --git a/lib/dummy-data/donasi/kategori.tsx b/lib/dummy-data/donasi/kategori.tsx new file mode 100644 index 0000000..7b679db --- /dev/null +++ b/lib/dummy-data/donasi/kategori.tsx @@ -0,0 +1,22 @@ +export const dummyDonasiKategori = [ + { + label: "Medis", + value: "medis", + }, + { + label: "Pendidikan", + value: "pendidikan", + }, + { + label: "Kesehatan", + value: "kesehatan", + }, + { + label: "Bantuan Sosial", + value: "bantuan_sosial", + }, + { + label: "Lainnya", + value: "lainnya", + }, +]; diff --git a/screens/Authentication/LoginView.tsx b/screens/Authentication/LoginView.tsx index e3322f6..27678dc 100644 --- a/screens/Authentication/LoginView.tsx +++ b/screens/Authentication/LoginView.tsx @@ -38,7 +38,8 @@ export default function LoginView() { // router.navigate(`/(application)/(image)/preview-image/${id}`); // router.replace("/(application)/(user)/event/(tabs)"); // router.replace("/(application)/coba"); - router.navigate("/investment/(tabs)") + // router.navigate("/investment/(tabs)") + router.navigate("/crowdfunding") } return (