From 52c16b25b7343b899a38035d3b91f9192f26ae29 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Wed, 13 Aug 2025 14:18:30 +0800 Subject: [PATCH 1/3] Admin Component Add: - GridViewCustomSpan - GridView_4_4_4 Fix: - BackButtonAntTitle: penambahan new component - SelectCustom: penambahan container style Admin Donasi Add: - admin/donation/[id] Fix: - admin/donation/[status]/status Admin Fix: perubahan nama halaman sesuai fitur ### No Issue --- .../admin/donation/[id]/[status]/index.tsx | 228 ++++++++++++++++++ .../[id]/[status]/transaction-detail.tsx | 80 ++++++ .../[id]/detail-disbursement-of-funds.tsx | 62 +++++ .../donation/[id]/disbursement-of-funds.tsx | 85 +++++++ .../[id]/list-disbursement-of-funds.tsx | 82 +++++++ .../admin/donation/[id]/list-of-donatur.tsx | 101 ++++++++ .../admin/donation/[id]/reject-input.tsx | 55 +++++ .../admin/donation/[status]/status.tsx | 86 +++---- .../admin/event/[id]/reject-input.tsx | 2 +- .../admin/job/[id]/reject-input.tsx | 2 +- .../admin/voting/[id]/reject-input.tsx | 2 +- components/Select/SelectCustom.tsx | 8 +- .../Admin/BackButtonAntTitle.tsx | 39 +-- .../_ShareComponent/GridViewCustomSpan.tsx | 40 +++ components/_ShareComponent/GridView_4_4_4.tsx | 34 +++ screens/Authentication/LoginView.tsx | 4 +- 16 files changed, 842 insertions(+), 68 deletions(-) create mode 100644 app/(application)/admin/donation/[id]/[status]/index.tsx create mode 100644 app/(application)/admin/donation/[id]/[status]/transaction-detail.tsx create mode 100644 app/(application)/admin/donation/[id]/detail-disbursement-of-funds.tsx create mode 100644 app/(application)/admin/donation/[id]/disbursement-of-funds.tsx create mode 100644 app/(application)/admin/donation/[id]/list-disbursement-of-funds.tsx create mode 100644 app/(application)/admin/donation/[id]/list-of-donatur.tsx create mode 100644 app/(application)/admin/donation/[id]/reject-input.tsx create mode 100644 components/_ShareComponent/GridViewCustomSpan.tsx create mode 100644 components/_ShareComponent/GridView_4_4_4.tsx diff --git a/app/(application)/admin/donation/[id]/[status]/index.tsx b/app/(application)/admin/donation/[id]/[status]/index.tsx new file mode 100644 index 0000000..2a5c8fe --- /dev/null +++ b/app/(application)/admin/donation/[id]/[status]/index.tsx @@ -0,0 +1,228 @@ +import { + ActionIcon, + AlertDefaultSystem, + BadgeCustom, + BaseBox, + ButtonCustom, + DrawerCustom, + DummyLandscapeImage, + MenuDrawerDynamicGrid, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { IconDot, IconList } from "@/components/_Icon/IconComponent"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject"; +import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview"; +import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8"; +import { MainColor } from "@/constants/color-palet"; +import { ICON_SIZE_BUTTON, TEXT_SIZE_LARGE } from "@/constants/constans-value"; +import { Ionicons } from "@expo/vector-icons"; +import { router, useLocalSearchParams } from "expo-router"; +import _ from "lodash"; +import React from "react"; + +export default function AdminDonationDetail() { + const { id, status } = useLocalSearchParams(); + const [openDrawer, setOpenDrawer] = React.useState(false); + + const colorBadge = () => { + if (status === "publish") { + return MainColor.green; + } else if (status === "review") { + return MainColor.orange; + } else if (status === "reject") { + return MainColor.red; + } else { + return MainColor.placeholder; + } + }; + + const listData = [ + { + label: "Penggalang Dana", + value: `Bagas Banuna ${id}`, + }, + { + label: "Judul", + value: `Donasi Lorem ipsum dolor sit amet, consectetur adipisicing elit.`, + }, + { + label: "Status", + value: ( + + {_.startCase(status as string)} + + ), + }, + { + label: "Durasi", + value: "30 Hari", + }, + { + label: "Target Dana", + value: "Rp 10.000.000", + }, + { + label: "Kategori", + value: "Kategori Donasi", + }, + { + label: "Total Donatur", + value: "-", + }, + { + label: "Progress", + value: "0 %", + }, + { + label: "Dana Terkumpul", + value: "Rp 0", + }, + ]; + + const listPencarianDana = [ + { + label: "Total Dana Dicairkan", + value: "Rp 0", + }, + { + label: "Sisa Dana", + value: "Rp 0", + }, + { + label: "Akumulasi Pencairan", + value: "0 kali", + }, + { + label: "Bank Tujuan", + value: "BNI", + }, + { + label: "Nomor Rekening", + value: "123456789", + }, + ]; + + const rightComponent = ( + } + onPress={() => { + setOpenDrawer(true); + }} + /> + ); + + return ( + <> + + } + > + {status === "publish" && ( + + + + Pencarian Dana + + + + {listPencarianDana.map((item, i) => ( + {item.label}} + value={{item.value}} + /> + ))} + + + } + onPress={() => { + router.push(`/admin/donation/${id}/disbursement-of-funds`); + }} + > + Cairkan Dana + + + + )} + + + + + {listData.map((item, i) => ( + {item.label}} + value={{item.value}} + /> + ))} + + + + {status === "review" && ( + { + AlertDefaultSystem({ + title: "Publish", + message: "Apakah anda yakin ingin mempublikasikan data ini?", + textLeft: "Batal", + textRight: "Ya", + onPressLeft: () => { + router.back(); + }, + onPressRight: () => { + router.back(); + }, + }); + }} + onReject={() => { + router.push(`/admin/donation/${id}/reject-input`); + }} + /> + )} + + {status === "reject" && ( + { + router.push(`/admin/donation/${id}/reject-input`); + }} + /> + )} + + + setOpenDrawer(false)} + height={"auto"} + > + , + path: `/admin/donation/${id}/list-of-donatur`, + }, + { + label: "Daftar Pencarian Dana", + icon: , + path: `/admin/donation/${id}/list-disbursement-of-funds`, + }, + ]} + onPressItem={(item) => { + setOpenDrawer(false); + router.push(item.path as any); + }} + /> + + + ); +} diff --git a/app/(application)/admin/donation/[id]/[status]/transaction-detail.tsx b/app/(application)/admin/donation/[id]/[status]/transaction-detail.tsx new file mode 100644 index 0000000..0140ad8 --- /dev/null +++ b/app/(application)/admin/donation/[id]/[status]/transaction-detail.tsx @@ -0,0 +1,80 @@ +import { + BadgeCustom, + BaseBox, + BoxButtonOnFooter, + ButtonCustom, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8"; +import { MainColor } from "@/constants/color-palet"; +import dayjs from "dayjs"; +import { router, useLocalSearchParams } from "expo-router"; + +export default function AdminDonasiTransactionDetail() { + const { id } = useLocalSearchParams(); + + const buttonAction = ( + + router.back()}>Terima + + ); + + const listData = [ + { + label: "Donatur", + value: "Bagas Banuna", + }, + { + label: "Bank", + value: "BCA", + }, + { + label: "Jumlah Donasi", + value: "Rp. 1.000.000", + }, + { + label: "Status", + value: Berhasil, + }, + { + label: "Tanggal", + value: dayjs().format("DD-MM-YYYY HH:mm:ss"), + }, + { + label: "Bukti Transfer", + value: ( + + router.push(`/(application)/(image)/preview-image/${id}`) + } + > + Cek + + ), + }, + ]; + + return ( + <> + } + footerComponent={buttonAction} + > + + + {listData.map((item, index) => ( + {item.label}} + value={{item.value}} + /> + ))} + + + + + ); +} diff --git a/app/(application)/admin/donation/[id]/detail-disbursement-of-funds.tsx b/app/(application)/admin/donation/[id]/detail-disbursement-of-funds.tsx new file mode 100644 index 0000000..2a5e4cc --- /dev/null +++ b/app/(application)/admin/donation/[id]/detail-disbursement-of-funds.tsx @@ -0,0 +1,62 @@ +import { + BaseBox, + ButtonCustom, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8"; +import dayjs from "dayjs"; +import { router, useLocalSearchParams } from "expo-router"; + +export default function AdminDonationDetailDisbursementOfFunds() { + const { id } = useLocalSearchParams(); + const listData = [ + { + label: "Nominal", + value: "Rp 1.000.000", + }, + { + label: "Tanggal", + value: dayjs().format("DD-MM-YYYY HH:mm"), + }, + { + label: "Judul", + value: `Judul Pencairan Dana ${id}`, + }, + { + label: "Deskripsi", + value: `Lorem ipsum dolor sit amet consectetur adipisicing elit. Itaque velit eos facere a dicta nemo repellendus harum laboriosam quos, earum reprehenderit. Nisi sapiente, quo earum quis alias ullam temporibus quidem.`, + }, + ]; + return ( + <> + + } + > + + + {listData.map((item, index) => ( + {item.label}} + value={{item.value}} + /> + ))} + + + + + router.push(`/(application)/(image)/preview-image/${id}`) + } + > + Cek Bukti Transaksi + + + + ); +} diff --git a/app/(application)/admin/donation/[id]/disbursement-of-funds.tsx b/app/(application)/admin/donation/[id]/disbursement-of-funds.tsx new file mode 100644 index 0000000..1a9424d --- /dev/null +++ b/app/(application)/admin/donation/[id]/disbursement-of-funds.tsx @@ -0,0 +1,85 @@ +import { + BaseBox, + BoxButtonOnFooter, + ButtonCenteredOnly, + ButtonCustom, + InformationBox, + Spacing, + StackCustom, + TextAreaCustom, + TextCustom, + TextInputCustom, + ViewWrapper, +} from "@/components"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import { router, useLocalSearchParams } from "expo-router"; + +export default function AdminDonationDisbursementOfFunds() { + const { id } = useLocalSearchParams(); + const handleSubmit = ( + + { + router.back(); + }} + > + Simpan + + + ); + + return ( + } + footerComponent={handleSubmit} + > + + + + Dana Tersisa + + + Rp 1.000.000 + + + + + + + Form Pencairan Dana + + + + + + + + + + + + + { + router.push(`/(application)/(image)/take-picture/${id}`); + }} + icon="upload" + > + Upload + + + + ); +} diff --git a/app/(application)/admin/donation/[id]/list-disbursement-of-funds.tsx b/app/(application)/admin/donation/[id]/list-disbursement-of-funds.tsx new file mode 100644 index 0000000..12c2a68 --- /dev/null +++ b/app/(application)/admin/donation/[id]/list-disbursement-of-funds.tsx @@ -0,0 +1,82 @@ +import { + ActionIcon, + CenterCustom, + Divider, + StackCustom, + TextCustom, + ViewWrapper +} from "@/components"; +import { IconView } from "@/components/_Icon/IconComponent"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import { GridViewCustomSpan } from "@/components/_ShareComponent/GridViewCustomSpan"; +import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; +import dayjs from "dayjs"; +import { router, useLocalSearchParams } from "expo-router"; +import { View } from "react-native"; + +export default function AdminDonasiListOfDisbursementOfFunds() { + const { id } = useLocalSearchParams(); + return ( + <> + + } + > + + Aksi + + } + component2={ + + Tanggal + + } + component3={ + + Nominal + + } + /> + + + {Array.from({ length: 10 }).map((_, index) => ( + + + } + onPress={() => { + router.push( + `/admin/donation/${id}/detail-disbursement-of-funds` + ); + }} + /> + + } + component2={ + + {dayjs() + .add(index + 1, "day") + .format("DD-MM-YYYY HH:mm")} + + } + component3={Rp. 1.000.000} + /> + + + ))} + + + + ); +} diff --git a/app/(application)/admin/donation/[id]/list-of-donatur.tsx b/app/(application)/admin/donation/[id]/list-of-donatur.tsx new file mode 100644 index 0000000..aafc6c6 --- /dev/null +++ b/app/(application)/admin/donation/[id]/list-of-donatur.tsx @@ -0,0 +1,101 @@ +import { + ActionIcon, + BadgeCustom, + CenterCustom, + SelectCustom, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { IconView } from "@/components/_Icon/IconComponent"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import { GridViewCustomSpan } from "@/components/_ShareComponent/GridViewCustomSpan"; +import { MainColor } from "@/constants/color-palet"; +import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; +import { dummyMasterStatusTransaction } from "@/lib/dummy-data/_master/status-transaction"; +import { router, useLocalSearchParams } from "expo-router"; +import React from "react"; +import { View } from "react-native"; +import { Divider } from "react-native-paper"; + +export default function AdminDonasiListOfDonatur() { + const { id } = useLocalSearchParams(); + const searchComponent = ( + + console.log(value)} + styleContainer={{ width: "100%", marginBottom: 0 }} + /> + + ); + return ( + <> + + } + > + + Aksi + + } + component2={ + + Donatur + + } + component3={ + + Status + + } + /> + + + {Array.from({ length: 10 }).map((_, index) => ( + + + } + onPress={() => { + router.push( + `/admin/donation/${id}/berhasil/transaction-detail` + ); + }} + /> + + } + component2={ + + Bagas Banuna + + } + component3={ + + Berhasil + + } + /> + + + ))} + + + + ); +} diff --git a/app/(application)/admin/donation/[id]/reject-input.tsx b/app/(application)/admin/donation/[id]/reject-input.tsx new file mode 100644 index 0000000..a9bf8a1 --- /dev/null +++ b/app/(application)/admin/donation/[id]/reject-input.tsx @@ -0,0 +1,55 @@ +import { + AlertDefaultSystem, + BoxButtonOnFooter, + TextAreaCustom, + ViewWrapper, +} from "@/components"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject"; +import { router, useLocalSearchParams } from "expo-router"; +import { useState } from "react"; + +export default function AdminDonationRejectInput() { + const { id } = useLocalSearchParams(); + const [value, setValue] = useState(id as string); + const buttonSubmit = ( + + + AlertDefaultSystem({ + title: "Reject", + message: "Apakah anda yakin ingin menolak data ini?", + textLeft: "Batal", + textRight: "Ya", + onPressLeft: () => { + router.back(); + }, + onPressRight: () => { + console.log("value:", value); + router.replace(`/admin/donation/reject/status`); + }, + }) + } + /> + + ); + + return ( + <> + } + > + + + + ); +} diff --git a/app/(application)/admin/donation/[status]/status.tsx b/app/(application)/admin/donation/[status]/status.tsx index ebf9c43..2e55595 100644 --- a/app/(application)/admin/donation/[status]/status.tsx +++ b/app/(application)/admin/donation/[status]/status.tsx @@ -1,18 +1,16 @@ import { ActionIcon, - BaseBox, SearchInput, Spacing, TextCustom, - ViewWrapper, + ViewWrapper } from "@/components"; import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage"; import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle"; import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue"; -import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage"; import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; import { Octicons } from "@expo/vector-icons"; -import { useLocalSearchParams } from "expo-router"; +import { router, useLocalSearchParams } from "expo-router"; import _ from "lodash"; import { Divider } from "react-native-paper"; @@ -26,50 +24,46 @@ export default function AdminDonationStatus() { ); return ( <> - }> - - - - - - + } + > + + + - {Array.from({ length: 10 }).map((_, index) => ( - - } - onPress={() => { - // router.push(`/admin/donation/${index}/${status}`); - }} - /> - } - value2={Username username} - value3={ - - Lorem ipsum dolor sit amet consectetur adipisicing elit. - Blanditiis asperiores quidem deleniti architecto eaque et - nostrum, ad consequuntur eveniet quisquam quae voluptatum - ducimus! Dolorem nobis modi officia debitis, beatae mollitia. - - } - /> - ))} - + {Array.from({ length: 10 }).map((_, index) => ( + + } + onPress={() => { + router.push(`/admin/donation/${index}/${status}`); + }} + /> + } + value2={Username username} + value3={ + + Lorem ipsum dolor sit amet consectetur adipisicing elit. + Blanditiis asperiores quidem deleniti architecto eaque et + nostrum, ad consequuntur eveniet quisquam quae voluptatum + ducimus! Dolorem nobis modi officia debitis, beatae mollitia. + + } + /> + ))} ); diff --git a/app/(application)/admin/event/[id]/reject-input.tsx b/app/(application)/admin/event/[id]/reject-input.tsx index d74cf06..3682545 100644 --- a/app/(application)/admin/event/[id]/reject-input.tsx +++ b/app/(application)/admin/event/[id]/reject-input.tsx @@ -39,7 +39,7 @@ export default function AdminEventRejectInput() { <> } + headerComponent={} > } + headerComponent={} > } + headerComponent={} > void; borderRadius?: number; + styleContainer?: StyleProp; }; const SelectCustom: React.FC = ({ @@ -35,6 +38,7 @@ const SelectCustom: React.FC = ({ disabled = false, // <-- default false onChange, borderRadius = 8, + styleContainer, }) => { const [modalVisible, setModalVisible] = useState(false); @@ -43,7 +47,7 @@ const SelectCustom: React.FC = ({ const hasError = required && value === null; // <-- check if empty and required return ( - + {label && ( {label} @@ -52,7 +56,7 @@ const SelectCustom: React.FC = ({ )} - + - - + + + {newComponent ? ( + newComponent + ) : ( {title} - - - {rightComponent} - - - - ); -} \ No newline at end of file + )} + + + {rightComponent} + + + + ); +} diff --git a/components/_ShareComponent/GridViewCustomSpan.tsx b/components/_ShareComponent/GridViewCustomSpan.tsx new file mode 100644 index 0000000..329b76e --- /dev/null +++ b/components/_ShareComponent/GridViewCustomSpan.tsx @@ -0,0 +1,40 @@ +import { Grid } from "@/components"; + +export const GridViewCustomSpan = ({ + span1, + span2, + span3, + component1, + component2, + component3, +}: { + span1: number; + span2: number; + span3: number; + component1: React.ReactNode; + component2: React.ReactNode; + component3: React.ReactNode; +}) => { + return ( + + + {component1} + + + {component2} + + + {component3} + + + ); +}; diff --git a/components/_ShareComponent/GridView_4_4_4.tsx b/components/_ShareComponent/GridView_4_4_4.tsx new file mode 100644 index 0000000..e4b74f7 --- /dev/null +++ b/components/_ShareComponent/GridView_4_4_4.tsx @@ -0,0 +1,34 @@ +import { Grid } from "@/components"; + +export const GridView_4_4_4 = ({ + component1, + component2, + component3, +}: { + component1: React.ReactNode; + component2: React.ReactNode; + component3: React.ReactNode; +}) => { + return ( + + + {component1} + + + {component2} + + + {component3} + + + ); +}; diff --git a/screens/Authentication/LoginView.tsx b/screens/Authentication/LoginView.tsx index af685d5..435b61f 100644 --- a/screens/Authentication/LoginView.tsx +++ b/screens/Authentication/LoginView.tsx @@ -84,9 +84,9 @@ export default function LoginView() { - {/* router.navigate("/admin/donation")}> + router.navigate("/admin/donation")}> Admin ( Delete Soon ) - */} + ); From 40cb0bfc474fed6db703fa4b7cf8c10fc13d2be2 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Wed, 13 Aug 2025 15:38:03 +0800 Subject: [PATCH 2/3] Admin Investment Add: - admin/investment/[id] - admin/investment/[status] Fix: - delete: publish, reject, review ### No Issue --- app/(application)/admin/_layout.tsx | 3 - .../admin/investment/[id]/[status]/index.tsx | 244 ++++++++++++++++++ .../[id]/[status]/transaction-detail.tsx | 80 ++++++ .../investment/[id]/list-of-investor.tsx | 107 ++++++++ .../admin/investment/[id]/reject-input.tsx | 55 ++++ .../admin/investment/[status]/status.tsx | 70 +++++ app/(application)/admin/investment/index.tsx | 36 ++- .../admin/investment/publish.tsx | 11 - app/(application)/admin/investment/reject.tsx | 11 - app/(application)/admin/investment/review.tsx | 11 - screens/Admin/listPageAdmin.tsx | 6 +- screens/Authentication/LoginView.tsx | 2 +- 12 files changed, 594 insertions(+), 42 deletions(-) create mode 100644 app/(application)/admin/investment/[id]/[status]/index.tsx create mode 100644 app/(application)/admin/investment/[id]/[status]/transaction-detail.tsx create mode 100644 app/(application)/admin/investment/[id]/list-of-investor.tsx create mode 100644 app/(application)/admin/investment/[id]/reject-input.tsx create mode 100644 app/(application)/admin/investment/[status]/status.tsx delete mode 100644 app/(application)/admin/investment/publish.tsx delete mode 100644 app/(application)/admin/investment/reject.tsx delete mode 100644 app/(application)/admin/investment/review.tsx diff --git a/app/(application)/admin/_layout.tsx b/app/(application)/admin/_layout.tsx index 94674c0..4ea3188 100644 --- a/app/(application)/admin/_layout.tsx +++ b/app/(application)/admin/_layout.tsx @@ -51,9 +51,6 @@ export default function AdminLayout() { {/* ================== Investment Start ================== */} - - - {/* ================== Investment End ================== */} {/* ================== Maps Start ================== */} diff --git a/app/(application)/admin/investment/[id]/[status]/index.tsx b/app/(application)/admin/investment/[id]/[status]/index.tsx new file mode 100644 index 0000000..ea75229 --- /dev/null +++ b/app/(application)/admin/investment/[id]/[status]/index.tsx @@ -0,0 +1,244 @@ +import { + ActionIcon, + AlertDefaultSystem, + BadgeCustom, + BaseBox, + ButtonCustom, + DrawerCustom, + DummyLandscapeImage, + MenuDrawerDynamicGrid, + ProgressCustom, + Spacing, + StackCustom, + TextCustom, + ViewWrapper +} from "@/components"; +import { IconProspectus } from "@/components/_Icon"; +import { IconDot, IconList } from "@/components/_Icon/IconComponent"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject"; +import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview"; +import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8"; +import { MainColor } from "@/constants/color-palet"; +import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; +import { router, useLocalSearchParams } from "expo-router"; +import _ from "lodash"; +import React from "react"; + +export default function AdminInvestmentDetail() { + const { id, status } = useLocalSearchParams(); + const [openDrawer, setOpenDrawer] = React.useState(false); + + const colorBadge = () => { + if (status === "publish") { + return MainColor.green; + } else if (status === "review") { + return MainColor.orange; + } else if (status === "reject") { + return MainColor.red; + } else { + return MainColor.placeholder; + } + }; + + const listData = [ + { + label: "Username", + value: `Bagas Banuna ${id}`, + }, + { + label: "Judul", + value: `Donasi Lorem ipsum dolor sit amet, consectetur adipisicing elit.`, + }, + { + label: "Status", + value: ( + + {_.startCase(status as string)} + + ), + }, + { + label: "Dana Dibutuhkan", + value: "Rp 10.000.000", + }, + { + label: "Harga Perlembar", + value: "Rp 2500", + }, + { + label: "Total Lembar", + value: "2490 lembar", + }, + { + label: "ROI", + value: "4 %", + }, + { + label: "Pembagian Deviden", + value: "3 bulan", + }, + { + label: "Jadwal Pembagian", + value: "Selamanya", + }, + { + label: "Pencarian Investor", + value: "30 Hari", + }, + ]; + + const rightComponent = ( + } + onPress={() => { + setOpenDrawer(true); + }} + /> + ); + + return ( + <> + + } + > + {status === "publish" && ( + + + + + Sisa Saham} + value={2490 lembar} + /> + Validasi Transaksi} + value={4 Transaksi} + /> + + + )} + + + + + {listData.map((item, i) => ( + {item.label}} + value={{item.value}} + /> + ))} + + + + + + File Prospektus} + value={ + + } + onPress={() => { + router.push(`/(application)/(file)/${id}`); + }} + > + Preview + + } + /> + File Dokumen} + value={ + + {Array.from({ length: 5 }).map((_, i) => ( + + } + onPress={() => { + router.push(`/(application)/(file)/${id}`); + }} + > + Dokumen {i + 1} + + ))} + + } + /> + + + + {status === "review" && ( + { + AlertDefaultSystem({ + title: "Publish", + message: "Apakah anda yakin ingin mempublikasikan data ini?", + textLeft: "Batal", + textRight: "Ya", + onPressLeft: () => { + router.back(); + }, + onPressRight: () => { + router.back(); + }, + }); + }} + onReject={() => { + router.push(`/admin/investment/${id}/reject-input`); + }} + /> + )} + + {status === "reject" && ( + { + router.push(`/admin/investment/${id}/reject-input`); + }} + /> + )} + + + setOpenDrawer(false)} + height={"auto"} + > + , + path: `/admin/investment/${id}/list-of-investor`, + }, + // { + // label: "Daftar Pencarian Dana", + // icon: , + // path: `/admin/donation/${id}/list-disbursement-of-funds`, + // }, + ]} + onPressItem={(item) => { + setOpenDrawer(false); + router.push(item.path as any); + }} + /> + + + ); +} diff --git a/app/(application)/admin/investment/[id]/[status]/transaction-detail.tsx b/app/(application)/admin/investment/[id]/[status]/transaction-detail.tsx new file mode 100644 index 0000000..c71cc13 --- /dev/null +++ b/app/(application)/admin/investment/[id]/[status]/transaction-detail.tsx @@ -0,0 +1,80 @@ +import { + BadgeCustom, + BaseBox, + BoxButtonOnFooter, + ButtonCustom, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8"; +import { MainColor } from "@/constants/color-palet"; +import dayjs from "dayjs"; +import { router, useLocalSearchParams } from "expo-router"; + +export default function AdminInvestmentTransactionDetail() { + const { id } = useLocalSearchParams(); + + const buttonAction = ( + + router.back()}>Terima + + ); + + const listData = [ + { + label: "Investor", + value: "Bagas Banuna", + }, + { + label: "Bank", + value: "BCA", + }, + { + label: "Jumlah Investasi", + value: "Rp. 1.000.000", + }, + { + label: "Status", + value: Berhasil, + }, + { + label: "Tanggal", + value: dayjs().format("DD-MM-YYYY HH:mm:ss"), + }, + { + label: "Bukti Transfer", + value: ( + + router.push(`/(application)/(image)/preview-image/${id}`) + } + > + Cek + + ), + }, + ]; + + return ( + <> + } + footerComponent={buttonAction} + > + + + {listData.map((item, index) => ( + {item.label}} + value={{item.value}} + /> + ))} + + + + + ); +} diff --git a/app/(application)/admin/investment/[id]/list-of-investor.tsx b/app/(application)/admin/investment/[id]/list-of-investor.tsx new file mode 100644 index 0000000..c2b4194 --- /dev/null +++ b/app/(application)/admin/investment/[id]/list-of-investor.tsx @@ -0,0 +1,107 @@ +import { + ActionIcon, + BadgeCustom, + CenterCustom, + SelectCustom, + StackCustom, + TextCustom, + ViewWrapper, +} from "@/components"; +import { IconView } from "@/components/_Icon/IconComponent"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import { GridViewCustomSpan } from "@/components/_ShareComponent/GridViewCustomSpan"; +import { MainColor } from "@/constants/color-palet"; +import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; +import { dummyMasterStatusTransaction } from "@/lib/dummy-data/_master/status-transaction"; +import { router, useLocalSearchParams } from "expo-router"; +import React from "react"; +import { View } from "react-native"; +import { Divider } from "react-native-paper"; + +export default function AdminInvestmentListOfInvestor() { + const { id } = useLocalSearchParams(); + const searchComponent = ( + + console.log(value)} + styleContainer={{ width: "100%", marginBottom: 0 }} + /> + + ); + + const headerComponent = ( + + + {searchComponent} + + ); + + return ( + <> + + + Aksi + + } + component2={ + + Investor + + } + component3={ + + Status + + } + /> + + + {Array.from({ length: 10 }).map((_, index) => ( + + + } + onPress={() => { + router.push( + `/admin/investment/${id}/berhasil/transaction-detail` + ); + }} + /> + + } + component2={ + + Bagas Banuna + + } + component3={ + + Berhasil + + } + /> + + + ))} + + + + ); +} diff --git a/app/(application)/admin/investment/[id]/reject-input.tsx b/app/(application)/admin/investment/[id]/reject-input.tsx new file mode 100644 index 0000000..e974139 --- /dev/null +++ b/app/(application)/admin/investment/[id]/reject-input.tsx @@ -0,0 +1,55 @@ +import { + AlertDefaultSystem, + BoxButtonOnFooter, + TextAreaCustom, + ViewWrapper, +} from "@/components"; +import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject"; +import { router, useLocalSearchParams } from "expo-router"; +import { useState } from "react"; + +export default function AdminInvestmentRejectInput() { + const { id } = useLocalSearchParams(); + const [value, setValue] = useState(id as string); + const buttonSubmit = ( + + + AlertDefaultSystem({ + title: "Reject", + message: "Apakah anda yakin ingin menolak data ini?", + textLeft: "Batal", + textRight: "Ya", + onPressLeft: () => { + router.back(); + }, + onPressRight: () => { + console.log("value:", value); + router.replace(`/admin/investment/reject/status`); + }, + }) + } + /> + + ); + + return ( + <> + } + > + + + + ); +} diff --git a/app/(application)/admin/investment/[status]/status.tsx b/app/(application)/admin/investment/[status]/status.tsx new file mode 100644 index 0000000..bfc4f45 --- /dev/null +++ b/app/(application)/admin/investment/[status]/status.tsx @@ -0,0 +1,70 @@ +import { + ActionIcon, + SearchInput, + Spacing, + TextCustom, + ViewWrapper +} from "@/components"; +import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage"; +import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle"; +import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue"; +import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; +import { Octicons } from "@expo/vector-icons"; +import { router, useLocalSearchParams } from "expo-router"; +import _ from "lodash"; +import { Divider } from "react-native-paper"; + +export default function AdminInvestmentStatus() { + const { status } = useLocalSearchParams(); + const rightComponent = ( + + ); + return ( + <> + + } + > + + + + + {Array.from({ length: 10 }).map((_, index) => ( + + } + onPress={() => { + router.push(`/admin/investment/${index}/${status}`); + }} + /> + } + value2={Username username} + value3={ + + Lorem ipsum dolor sit amet consectetur adipisicing elit. + Blanditiis asperiores quidem deleniti architecto eaque et + nostrum, ad consequuntur eveniet quisquam quae voluptatum + ducimus! Dolorem nobis modi officia debitis, beatae mollitia. + + } + /> + ))} + + + ); +} diff --git a/app/(application)/admin/investment/index.tsx b/app/(application)/admin/investment/index.tsx index 876ce21..553bfe0 100644 --- a/app/(application)/admin/investment/index.tsx +++ b/app/(application)/admin/investment/index.tsx @@ -1,11 +1,43 @@ -import { TextCustom, ViewWrapper } from "@/components"; +import { Spacing, StackCustom, ViewWrapper } from "@/components"; +import { + IconPublish, + IconReject, + IconReview, +} from "@/components/_Icon/IconComponent"; +import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard"; +import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage"; +import { MainColor } from "@/constants/color-palet"; export default function AdminInvestment() { return ( <> - Admin Investment + + + + {listData.map((item, i) => ( + + ))} + ); } + +const listData = [ + { + label: "Publish", + value: 3, + icon: , + }, + { + label: "Review", + value: 5, + icon: , + }, + { + label: "Reject", + value: 8, + icon: , + }, +]; diff --git a/app/(application)/admin/investment/publish.tsx b/app/(application)/admin/investment/publish.tsx deleted file mode 100644 index a194391..0000000 --- a/app/(application)/admin/investment/publish.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { TextCustom, ViewWrapper } from "@/components"; - -export default function AdminInvestmentPublish() { - return ( - <> - - Admin Investment Publish - - - ); -} diff --git a/app/(application)/admin/investment/reject.tsx b/app/(application)/admin/investment/reject.tsx deleted file mode 100644 index 26292a7..0000000 --- a/app/(application)/admin/investment/reject.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { TextCustom, ViewWrapper } from "@/components"; - -export default function AdminInvestmentReject() { - return ( - <> - - Admin Investment Reject - - - ); -} diff --git a/app/(application)/admin/investment/review.tsx b/app/(application)/admin/investment/review.tsx deleted file mode 100644 index 37e018e..0000000 --- a/app/(application)/admin/investment/review.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { TextCustom, ViewWrapper } from "@/components"; - -export default function AdminInvestmentReview() { - return ( - <> - - Admin Investment Review - - - ); -} diff --git a/screens/Admin/listPageAdmin.tsx b/screens/Admin/listPageAdmin.tsx index e38da87..8b9fb8f 100644 --- a/screens/Admin/listPageAdmin.tsx +++ b/screens/Admin/listPageAdmin.tsx @@ -13,9 +13,9 @@ const adminListMenu: NavbarItem[] = [ icon: "wallet", links: [ { label: "Dashboard", link: "/admin/investment" }, - { label: "Publish", link: "/admin/investment/publish" }, - { label: "Review", link: "/admin/investment/review" }, - { label: "Reject", link: "/admin/investment/reject" }, + { label: "Publish", link: "/admin/investment/publish/status" }, + { label: "Review", link: "/admin/investment/review/status" }, + { label: "Reject", link: "/admin/investment/reject/status" }, ], }, { diff --git a/screens/Authentication/LoginView.tsx b/screens/Authentication/LoginView.tsx index 435b61f..09ee19a 100644 --- a/screens/Authentication/LoginView.tsx +++ b/screens/Authentication/LoginView.tsx @@ -84,7 +84,7 @@ export default function LoginView() { - router.navigate("/admin/donation")}> + router.navigate("/admin/investment")}> Admin ( Delete Soon ) From 0fa6d54dbe830da3f186c41f134bc9efa5f814e2 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Wed, 13 Aug 2025 16:33:31 +0800 Subject: [PATCH 3/3] Admin Donation Fix: - dmin/donation/[id]/[status]/index Add: - screens/Admin/Donation/ ### No Issue --- .../admin/donation/[id]/[status]/index.tsx | 155 +++++++++++------- screens/Admin/Donation/BoxOfDonationStory.tsx | 34 ++++ 2 files changed, 127 insertions(+), 62 deletions(-) create mode 100644 screens/Admin/Donation/BoxOfDonationStory.tsx diff --git a/app/(application)/admin/donation/[id]/[status]/index.tsx b/app/(application)/admin/donation/[id]/[status]/index.tsx index 2a5c8fe..3c74b4a 100644 --- a/app/(application)/admin/donation/[id]/[status]/index.tsx +++ b/app/(application)/admin/donation/[id]/[status]/index.tsx @@ -7,6 +7,8 @@ import { DrawerCustom, DummyLandscapeImage, MenuDrawerDynamicGrid, + ProgressCustom, + Spacing, StackCustom, TextCustom, ViewWrapper, @@ -18,10 +20,12 @@ import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview"; import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8"; import { MainColor } from "@/constants/color-palet"; import { ICON_SIZE_BUTTON, TEXT_SIZE_LARGE } from "@/constants/constans-value"; +import AdminDonation_BoxOfDonationStory from "@/screens/Admin/Donation/BoxOfDonationStory"; import { Ionicons } from "@expo/vector-icons"; import { router, useLocalSearchParams } from "expo-router"; import _ from "lodash"; import React from "react"; +import { View } from "react-native"; export default function AdminDonationDetail() { const { id, status } = useLocalSearchParams(); @@ -68,18 +72,18 @@ export default function AdminDonationDetail() { label: "Kategori", value: "Kategori Donasi", }, - { - label: "Total Donatur", - value: "-", - }, - { - label: "Progress", - value: "0 %", - }, - { - label: "Dana Terkumpul", - value: "Rp 0", - }, + // { + // label: "Total Donatur", + // value: "-", + // }, + // { + // label: "Progress", + // value: "0 %", + // }, + // { + // label: "Dana Terkumpul", + // value: "Rp 0", + // }, ]; const listPencarianDana = [ @@ -114,6 +118,8 @@ export default function AdminDonationDetail() { /> ); + + return ( <> {status === "publish" && ( - - - - Pencarian Dana - + + + + + Pencarian Dana + - - {listPencarianDana.map((item, i) => ( - {item.label}} - value={{item.value}} - /> - ))} + + {listPencarianDana.map((item, i) => ( + {item.label}} + value={{item.value}} + /> + ))} + + + } + onPress={() => { + router.push(`/admin/donation/${id}/disbursement-of-funds`); + }} + > + Cairkan Dana + - - } - onPress={() => { - router.push(`/admin/donation/${id}/disbursement-of-funds`); - }} - > - Cairkan Dana - - - + + + + + + + Jumlah Donatur} + value={0 orang} + /> + Dana Terkumpul} + value={Rp 0} + /> + + + )} @@ -168,34 +191,42 @@ export default function AdminDonationDetail() { {status === "review" && ( - { - AlertDefaultSystem({ - title: "Publish", - message: "Apakah anda yakin ingin mempublikasikan data ini?", - textLeft: "Batal", - textRight: "Ya", - onPressLeft: () => { - router.back(); - }, - onPressRight: () => { - router.back(); - }, - }); - }} - onReject={() => { - router.push(`/admin/donation/${id}/reject-input`); - }} - /> + + + + { + AlertDefaultSystem({ + title: "Publish", + message: "Apakah anda yakin ingin mempublikasikan data ini?", + textLeft: "Batal", + textRight: "Ya", + onPressLeft: () => { + router.back(); + }, + onPressRight: () => { + router.back(); + }, + }); + }} + onReject={() => { + router.push(`/admin/donation/${id}/reject-input`); + }} + /> + )} {status === "reject" && ( - { - router.push(`/admin/donation/${id}/reject-input`); - }} - /> + + + + { + router.push(`/admin/donation/${id}/reject-input`); + }} + /> + )} diff --git a/screens/Admin/Donation/BoxOfDonationStory.tsx b/screens/Admin/Donation/BoxOfDonationStory.tsx new file mode 100644 index 0000000..a50540f --- /dev/null +++ b/screens/Admin/Donation/BoxOfDonationStory.tsx @@ -0,0 +1,34 @@ +import { + BaseBox, + TextCustom, + Spacing, + StackCustom, + DummyLandscapeImage, +} from "@/components"; + +export default function AdminDonation_BoxOfDonationStory() { + return ( + <> + + Cerita Penggalang Dana + + + + + Lorem ipsum dolor sit, amet consectetur adipisicing elit. Rem magni + perspiciatis eius ipsam provident, impedit, fugiat aliquid nobis + pariatur asperiores fuga quidem temporibus labore, molestias + perferendis optio ipsum. Praesentium, tempore? + + + + Lorem ipsum dolor sit, amet consectetur adipisicing elit. Rem magni + perspiciatis eius ipsam provident, impedit, fugiat aliquid nobis + pariatur asperiores fuga quidem temporibus labore, molestias + perferendis optio ipsum. Praesentium, tempore? + + + + + ); +}