# feat :
## Deskripsi : - Notifikasi investasi ## Issue : Gerbang pembayaran
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { Box, Center } from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import { ScrollOnly } from "next-scroll-loader";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { donasi_funGetListPencairanDanaById } from "../../fun/get/get_list_pencairan_dana_by_id";
|
||||
import { MODEL_DONASI_PENCAIRAN_DANA } from "../../model/interface";
|
||||
import { ComponentDonasi_CardDonatur } from "./ui_card_donatur";
|
||||
import { ComponentDonasi_CardPencairanDana } from "./card_pencairan_dana";
|
||||
|
||||
export function ComponentDonasi_InformasiPencairanDana({
|
||||
donasiId,
|
||||
listPD,
|
||||
}: {
|
||||
donasiId: string;
|
||||
listPD: MODEL_DONASI_PENCAIRAN_DANA[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [data, setData] = useState(listPD);
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
|
||||
return (
|
||||
<>
|
||||
{_.isEmpty(listPD) ? (
|
||||
<ComponentGlobal_IsEmptyData height={20} />
|
||||
) : (
|
||||
<Box>
|
||||
<ScrollOnly
|
||||
height="62vh"
|
||||
renderLoading={() => (
|
||||
<Center>
|
||||
<ComponentGlobal_Loader size={25} />
|
||||
</Center>
|
||||
)}
|
||||
data={data}
|
||||
setData={setData}
|
||||
moreData={async () => {
|
||||
const loadData = await donasi_funGetListPencairanDanaById({
|
||||
page: activePage + 1,
|
||||
donasiId: donasiId,
|
||||
});
|
||||
|
||||
setActivePage((val) => val + 1);
|
||||
|
||||
return loadData;
|
||||
}}
|
||||
>
|
||||
{(item) => <ComponentDonasi_CardPencairanDana data={item} />}
|
||||
</ScrollOnly>
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { MainColor, AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||
import { Paper, Stack, Grid, Title, Text } from "@mantine/core";
|
||||
import { MODEL_DONASI } from "../../model/interface";
|
||||
import TampilanRupiahDonasi from "../tampilan_rupiah";
|
||||
|
||||
export function ComponentDonasi_BoxPencariranDana({ akumulasi }: { akumulasi: MODEL_DONASI }) {
|
||||
return (
|
||||
<>
|
||||
<Paper
|
||||
style={{
|
||||
backgroundColor: MainColor.darkblue,
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
padding: "15px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
marginBottom: "10px",
|
||||
}}
|
||||
>
|
||||
<Stack>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Title order={5}>
|
||||
<TampilanRupiahDonasi nominal={akumulasi.totalPencairan} />
|
||||
</Title>
|
||||
<Text fz={"xs"}>Dana sudah dicairkan</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Title order={5}>{akumulasi.akumulasiPencairan} kali</Title>
|
||||
<Text fz={"xs"}>Pencairan dana</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<ComponentGlobal_BoxInformation
|
||||
informasi=" Pencairan dana akan dilakukan oleh Admin HIPMI tanpa campur tangan
|
||||
pihak manapun, jika berita pencairan dana dibawah tidak sesuai
|
||||
dengan kabar yang diberikan oleh PENGGALANG DANA. Maka pegguna lain
|
||||
dapat melaporkannya pada Admin HIPMI !"
|
||||
/>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
113
src/app_modules/donasi/component/card_view/card_invoice.tsx
Normal file
113
src/app_modules/donasi/component/card_view/card_invoice.tsx
Normal file
@@ -0,0 +1,113 @@
|
||||
import {
|
||||
AspectRatio,
|
||||
Badge,
|
||||
Card,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Paper,
|
||||
Progress,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { MODEL_DONASI_INVOICE } from "../../model/interface";
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import ComponentDonasi_TampilanHitungMundur from "../tampilan_hitung_mundur";
|
||||
import TampilanRupiahDonasi from "../tampilan_rupiah";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import ComponentGlobal_CardLoadingOverlay from "@/app_modules/_global/loading_card";
|
||||
|
||||
export function ComponentDonasi_CardInvoice({
|
||||
data,
|
||||
}: {
|
||||
data: MODEL_DONASI_INVOICE;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [donasiId, setEventId] = useState("");
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
async function onCekInvoice() {
|
||||
if (data.donasiMaster_StatusInvoiceId === "1") {
|
||||
return router.push(RouterDonasi.detail_donasi_saya + `${data?.id}`);
|
||||
} else {
|
||||
if (data.donasiMaster_StatusInvoiceId === "2") {
|
||||
return router.push(RouterDonasi.proses_transaksi + `${data?.id}`);
|
||||
} else {
|
||||
if (data.donasiMaster_StatusInvoiceId === "3") {
|
||||
return router.push(RouterDonasi.invoice + `${data?.id}`);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal("Gagal Melihat Invoice");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
style={{
|
||||
backgroundColor: AccentColor.blue,
|
||||
border: `2px solid ${AccentColor.darkblue}`,
|
||||
padding: "15px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
marginBottom: "15px",
|
||||
}}
|
||||
onClick={() => onCekInvoice()}
|
||||
>
|
||||
<Stack>
|
||||
<Grid>
|
||||
<Grid.Col span={5}>
|
||||
<Stack spacing={5}>
|
||||
<Stack spacing={0}>
|
||||
<Text fz={"xs"} fw={"bold"} truncate>
|
||||
{data.Donasi.title}
|
||||
</Text>
|
||||
<ComponentDonasi_TampilanHitungMundur
|
||||
durasi={data.Donasi.DonasiMaster_Durasi.name}
|
||||
publishTime={data.Donasi.publishTime}
|
||||
textSize={10}
|
||||
/>
|
||||
</Stack>
|
||||
<Progress value={+data.Donasi.progres} color="orange" />
|
||||
<Group position="apart">
|
||||
<Stack spacing={0}>
|
||||
<Text fz={10}>Donasi Saya</Text>
|
||||
<Text fz={10} fw={"bold"} c={"orange"} truncate>
|
||||
<TampilanRupiahDonasi nominal={+data.nominal} />
|
||||
</Text>
|
||||
</Stack>
|
||||
</Group>
|
||||
<Badge size="xs" variant="filled" color="yellow">
|
||||
<Text>{data.DonasiMaster_StatusInvoice.name}</Text>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={7}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Paper radius={"md"}>
|
||||
<Image
|
||||
alt="Foto"
|
||||
src={RouterDonasi.api_gambar + `${data.Donasi.imagesId}`}
|
||||
radius={"md"}
|
||||
/>
|
||||
</Paper>
|
||||
</AspectRatio>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
{/* {width > 575 ? "" : <Divider />} */}
|
||||
</Stack>
|
||||
{visible && donasiId !== "" ? (
|
||||
<ComponentGlobal_CardLoadingOverlay />
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import {
|
||||
Paper,
|
||||
Stack,
|
||||
Title,
|
||||
Spoiler,
|
||||
Center,
|
||||
Button,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { IconImageInPicture } from "@tabler/icons-react";
|
||||
import moment from "moment";
|
||||
|
||||
import { MODEL_DONASI_PENCAIRAN_DANA } from "../../model/interface";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export function ComponentDonasi_CardPencairanDana({
|
||||
data,
|
||||
}: {
|
||||
data: MODEL_DONASI_PENCAIRAN_DANA;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Paper
|
||||
style={{
|
||||
padding: "15px",
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
}}
|
||||
>
|
||||
<Text fz={"xs"}>{moment(data.createdAt).format("ll")}</Text>
|
||||
<Stack spacing={"lg"}>
|
||||
<Title order={5}>{data.title}</Title>
|
||||
<Spoiler
|
||||
maxHeight={50}
|
||||
hideLabel="Sembunyikan"
|
||||
showLabel="Baca Selengkapnya"
|
||||
>
|
||||
{data.deskripsi}
|
||||
</Spoiler>
|
||||
<Center>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
leftIcon={<IconImageInPicture />}
|
||||
onClick={() => {
|
||||
// open();
|
||||
// setIdGambar(e.imagesId);
|
||||
router.push(RouterDonasi.bukti_transfer + data.imagesId, {
|
||||
scroll: false,
|
||||
});
|
||||
}}
|
||||
bg={MainColor.yellow}
|
||||
color="yellow"
|
||||
c={"black"}
|
||||
>
|
||||
Bukti Transfer
|
||||
</Button>
|
||||
</Center>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -5,16 +5,19 @@ import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import {
|
||||
AspectRatio,
|
||||
Box,
|
||||
Card,
|
||||
Grid,
|
||||
Image,
|
||||
Paper,
|
||||
Progress,
|
||||
Stack,
|
||||
Text
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentDonasi_TampilanHitungMundur from "../tampilan_hitung_mundur";
|
||||
import TampilanRupiahDonasi from "../tampilan_rupiah";
|
||||
import { useState } from "react";
|
||||
import ComponentGlobal_CardLoadingOverlay from "@/app_modules/_global/loading_card";
|
||||
|
||||
export default function ComponentDonasi_CardPublish({
|
||||
data,
|
||||
@@ -23,12 +26,13 @@ export default function ComponentDonasi_CardPublish({
|
||||
data: any;
|
||||
path: string;
|
||||
}) {
|
||||
|
||||
const router = useRouter();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [donasiId, setDonasiId] = useState("");
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box
|
||||
<Card
|
||||
style={{
|
||||
padding: "15px",
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
@@ -38,6 +42,8 @@ export default function ComponentDonasi_CardPublish({
|
||||
marginBottom: "15px",
|
||||
}}
|
||||
onClick={() => {
|
||||
setVisible(true);
|
||||
setDonasiId(data.id);
|
||||
router.push(path + `${data.id}`);
|
||||
}}
|
||||
>
|
||||
@@ -78,7 +84,12 @@ export default function ComponentDonasi_CardPublish({
|
||||
</Grid>
|
||||
{/* {width > 575 ? "" : <Divider />} */}
|
||||
</Stack>
|
||||
</Box>
|
||||
{visible && donasiId !== "" ? (
|
||||
<ComponentGlobal_CardLoadingOverlay />
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -8,9 +8,12 @@ import {
|
||||
Paper,
|
||||
Image,
|
||||
Text,
|
||||
Card,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { MODEL_DONASI } from "../../model/interface";
|
||||
import { useState } from "react";
|
||||
import ComponentGlobal_CardLoadingOverlay from "@/app_modules/_global/loading_card";
|
||||
|
||||
export function ComponentDonasi_CardStatus({
|
||||
data,
|
||||
@@ -20,9 +23,12 @@ export function ComponentDonasi_CardStatus({
|
||||
path: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [donasiId, setDonasiId] = useState("");
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box
|
||||
<Card
|
||||
style={{
|
||||
padding: "15px",
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
@@ -31,7 +37,11 @@ export function ComponentDonasi_CardStatus({
|
||||
color: "white",
|
||||
marginBottom: "15px",
|
||||
}}
|
||||
onClick={() => router.push(path + `${data.id}`)}
|
||||
onClick={() => {
|
||||
setVisible(true);
|
||||
setDonasiId(data.id);
|
||||
router.push(path + `${data.id}`);
|
||||
}}
|
||||
>
|
||||
<Stack>
|
||||
<Grid>
|
||||
@@ -65,7 +75,12 @@ export function ComponentDonasi_CardStatus({
|
||||
</Grid>
|
||||
{/* {width > 575 ? "" : <Divider />} */}
|
||||
</Stack>
|
||||
</Box>
|
||||
{visible && donasiId !== "" ? (
|
||||
<ComponentGlobal_CardLoadingOverlay />
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { Paper, Grid, Center, Stack, Title, Group, Text } from "@mantine/core";
|
||||
import { IconMoodSmileBeam } from "@tabler/icons-react";
|
||||
import { MODEL_DONASI_INVOICE } from "../../model/interface";
|
||||
import TampilanRupiahDonasi from "../tampilan_rupiah";
|
||||
|
||||
export function ComponentDonasi_CardDonatur({ data }: { data: MODEL_DONASI_INVOICE }){
|
||||
return (
|
||||
<>
|
||||
<Paper
|
||||
style={{
|
||||
backgroundColor: AccentColor.blue,
|
||||
border: `2px solid ${AccentColor.darkblue}`,
|
||||
padding: "15px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
marginBottom: "10px",
|
||||
}}
|
||||
>
|
||||
<Grid>
|
||||
<Grid.Col span={3}>
|
||||
<Center h={"100%"}>
|
||||
{/* <Avatar variant="filled" radius={"xl"} size={"md"} /> */}
|
||||
<IconMoodSmileBeam size={50} />
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={9}>
|
||||
<Stack spacing={0}>
|
||||
<Title order={5}>{data.Author.username}</Title>
|
||||
<Group spacing={"xs"}>
|
||||
<Text fz={"xs"}>Berdonasi sebesar</Text>
|
||||
<Text truncate fw={"bold"}>
|
||||
<TampilanRupiahDonasi nominal={+data.nominal} />
|
||||
</Text>
|
||||
</Group>
|
||||
<Text fz={"xs"}>
|
||||
{new Intl.DateTimeFormat("id-ID", {
|
||||
dateStyle: "full",
|
||||
}).format(data?.createdAt)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export default function ComponentDonasi_ListKabar({
|
||||
cursor: "pointer",
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
marginBottom: "5px",
|
||||
marginBottom: "10px",
|
||||
}}
|
||||
onClick={() => router.push(route + `${kabar.id}`)}
|
||||
>
|
||||
Reference in New Issue
Block a user