Revisi Tampilan Admin
# fix : - Tampilan Donasi # feat : - Penambahan App Information ## No Issuee
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||
import {
|
||||
ActionIcon,
|
||||
AspectRatio,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
FileButton,
|
||||
@@ -13,27 +11,24 @@ import {
|
||||
Select,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Textarea,
|
||||
TextInput
|
||||
} from "@mantine/core";
|
||||
import { IconCamera } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import ComponentDonasi_NotedBox from "../component/noted_box";
|
||||
import { MODEL_DONASI_ALL_MASTER } from "../model/interface";
|
||||
import { useState } from "react";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import Donasi_funCreateTemporary from "../fun/create/fun_create_donasi_temporary";
|
||||
import toast from "react-simple-toasts";
|
||||
import _ from "lodash";
|
||||
import { notifications } from "@mantine/notifications";
|
||||
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
||||
import {
|
||||
ComponentGlobal_WarningMaxUpload,
|
||||
maksimalUploadFile,
|
||||
} from "@/app_modules/component_global/variabel_global";
|
||||
import _ from "lodash";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
import ComponentDonasi_NotedBox from "../component/noted_box";
|
||||
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
||||
import Donasi_funCreateTemporary from "../fun/create/fun_create_donasi_temporary";
|
||||
import { gs_donasi_tabs_posting } from "../global_state";
|
||||
import { MODEL_DONASI_ALL_MASTER } from "../model/interface";
|
||||
|
||||
export default function CreateDonasi({
|
||||
masterKategori,
|
||||
|
||||
@@ -23,6 +23,8 @@ import _ from "lodash";
|
||||
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
||||
import ComponentDonasi_NotedBox from "../../component/noted_box";
|
||||
import { Donasi_funCreateNotif } from "../../fun/create/fun_create_notif";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
||||
const router = useRouter();
|
||||
@@ -137,14 +139,16 @@ async function onSave(
|
||||
|
||||
await Donasi_funCreateKabar(body as any, gambar).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
await Donasi_funCreateNotif(body.donasiId, res.kabarId as any).then((val) => {
|
||||
if (val.status === 200) {
|
||||
NotifBerhasil(res.message);
|
||||
router.back();
|
||||
await Donasi_funCreateNotif(body.donasiId, res.kabarId as any).then(
|
||||
(val) => {
|
||||
if (val.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.back();
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
} else {
|
||||
NotifGagal(res.message);
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import React from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutDonasi_CreateKabar({
|
||||
children,
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import { AppShell } from "@mantine/core"
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"
|
||||
import React from "react"
|
||||
import ComponentDonasi_HeaderTamplate from "../component/header_tamplate"
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"
|
||||
|
||||
export default function LayoutCreateDonasi({children}: {children: React.ReactNode}){
|
||||
return<>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell, Button, Center, Footer } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import { Button, Center, Footer } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
|
||||
export default function LayoutDonasi_DetailNotif({
|
||||
children,
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
"use client"
|
||||
|
||||
import { AppShell } from "@mantine/core"
|
||||
import React from "react"
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate"
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi"
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"
|
||||
import React from "react"
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate"
|
||||
|
||||
export default function LayoutDetailDonasiSaya({children}: {children: React.ReactNode}){
|
||||
return<>
|
||||
|
||||
@@ -1,30 +1,23 @@
|
||||
"use client";
|
||||
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import {
|
||||
ActionIcon,
|
||||
AppShell,
|
||||
Button,
|
||||
Footer,
|
||||
Group,
|
||||
Header,
|
||||
Modal,
|
||||
Stack,
|
||||
Title,
|
||||
Title
|
||||
} from "@mantine/core";
|
||||
import React, { useState } from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import {
|
||||
IconChevronLeft,
|
||||
IconEdit,
|
||||
IconMessageShare,
|
||||
IconEdit
|
||||
} from "@tabler/icons-react";
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import router from "next/router";
|
||||
import { title } from "process";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { data } from "autoprefixer";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import React, { useState } from "react";
|
||||
|
||||
export default function LayoutDetailDraftDonasi({
|
||||
children,
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
AppShell,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
Footer,
|
||||
Header,
|
||||
} from "@mantine/core";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import FooterDonasi from "../../component/footer_close_donasi";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutDetailKabarDonasi({
|
||||
children,
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import ButtonDonasi from "@/app_modules/donasi/component/footer_button_donasi";
|
||||
import FooterDonasi from "@/app_modules/donasi/component/footer_close_donasi";
|
||||
import ComponentDonasi_HeaderTamplate from "@/app_modules/donasi/component/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutCeritaPenggalangDonasi({
|
||||
@@ -28,11 +26,11 @@ export default function LayoutCeritaPenggalangDonasi({
|
||||
);
|
||||
}
|
||||
return (
|
||||
<AppShell
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={<ComponentDonasi_HeaderTamplate title="Cerita Penggalang Dana" />}
|
||||
footer={<ButtonDonasi donasiId={donasiId}/>}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
"use dev";
|
||||
|
||||
import ComponentDonasi_IsEmptyData from "@/app_modules/donasi/component/is_empty_data";
|
||||
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
||||
@@ -56,7 +57,11 @@ export default function DonaturDonasi({
|
||||
<TampilanRupiahDonasi nominal={+e.nominal} />
|
||||
</Text>
|
||||
</Group>
|
||||
<Text fz={"xs"}>{moment(e.createdAt).format("ll")}</Text>
|
||||
<Text fz={"xs"}>
|
||||
{new Intl.DateTimeFormat("id-ID", {
|
||||
dateStyle: "full",
|
||||
}).format(e?.createdAt)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import React from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../../../component/header_tamplate";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutDonaturDonasi({
|
||||
children,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell, Box, Button, Center, Footer, Stack } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
import ButtonDonasi from "../../component/footer_button_donasi";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import { Footer, Stack } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ButtonDonasi from "../../component/footer_button_donasi";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
|
||||
export default function LayoutDetailMainDonasi({
|
||||
children,
|
||||
|
||||
@@ -100,7 +100,7 @@ function InformasiPenggalang({ value }: { value: MODEL_USER }) {
|
||||
</Group>
|
||||
<Group>
|
||||
<IconBrandGmail />
|
||||
<Text>user1@gmail.com</Text>
|
||||
<Text>{value?.Profile?.email}</Text>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
@@ -13,6 +13,7 @@ export async function Donasi_funCreateInvoice(data: any) {
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
if (!res) return { status: 400, message: "Gagal membuat invoice" };
|
||||
revalidatePath("/dev/donasi/main/donasi_saya")
|
||||
return {
|
||||
|
||||
@@ -16,6 +16,7 @@ export async function Donasi_getAuthorById(authorId: string) {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
email: true,
|
||||
imagesId: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -4,12 +4,17 @@ import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Donasi_getListDonatur(donasiId: string) {
|
||||
const data = await prisma.donasi_Invoice.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
donasiId: donasiId,
|
||||
donasiMaster_StatusInvoiceId: "1",
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
nominal: true,
|
||||
DonasiMaster_StatusInvoice: true,
|
||||
donasiMaster_StatusInvoiceId: true,
|
||||
|
||||
@@ -5,15 +5,18 @@ import prisma from "@/app/lib/prisma";
|
||||
export async function Donasi_getListKabar(donasiId: string) {
|
||||
// console.log(donasiId)
|
||||
const data = await prisma.donasi_Kabar.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
donasiId: donasiId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
deskripsi: true,
|
||||
createdAt: true
|
||||
}
|
||||
id: true,
|
||||
title: true,
|
||||
deskripsi: true,
|
||||
createdAt: true,
|
||||
},
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
import prisma from "@/app/lib/prisma"
|
||||
|
||||
export async function Donasi_getListPencairanDanaById(donasiId:string) {
|
||||
|
||||
const data = await prisma.donasi_PencairanDana.findMany({
|
||||
orderBy:{
|
||||
createdAt: "desc"
|
||||
},
|
||||
where: {
|
||||
donasiId: donasiId
|
||||
}
|
||||
})
|
||||
|
||||
// console.log(data)
|
||||
|
||||
return data
|
||||
}
|
||||
@@ -1,8 +1,15 @@
|
||||
"use server"
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma"
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Donasi_getMasterBank() {
|
||||
const data = await prisma.donasiMaster_Bank.findMany({})
|
||||
return data
|
||||
}
|
||||
const data = await prisma.masterBank.findMany({
|
||||
// orderBy: {
|
||||
// createdAt: "asc",
|
||||
// },
|
||||
where: {
|
||||
active: true,
|
||||
},
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
12
src/app_modules/donasi/fun/master/get_nomor_admin.ts
Normal file
12
src/app_modules/donasi/fun/master/get_nomor_admin.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export default async function donasi_getMasterNomorAdmin() {
|
||||
const get = await prisma.nomorAdmin.findFirst({
|
||||
where: {
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
return get;
|
||||
}
|
||||
@@ -2,39 +2,29 @@
|
||||
|
||||
import {
|
||||
ActionIcon,
|
||||
AppShell,
|
||||
Center,
|
||||
Flex,
|
||||
Footer,
|
||||
Grid,
|
||||
Group,
|
||||
Header,
|
||||
Indicator,
|
||||
Text,
|
||||
Title,
|
||||
Title
|
||||
} from "@mantine/core";
|
||||
import React, { useState } from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../component/header_tamplate";
|
||||
|
||||
import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import {
|
||||
IconBell,
|
||||
IconChevronLeft,
|
||||
IconCurrencyDollar,
|
||||
IconGift,
|
||||
IconGiftCardFilled,
|
||||
IconHome,
|
||||
IconMoneybag,
|
||||
IconSend,
|
||||
IconMoneybag
|
||||
} from "@tabler/icons-react";
|
||||
import toast from "react-simple-toasts";
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { gs_donasi_hot_menu } from "../global_state";
|
||||
import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
|
||||
import { title } from "process";
|
||||
import _ from "lodash";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutDonasi({
|
||||
children,
|
||||
@@ -89,7 +79,8 @@ export default function LayoutDonasi({
|
||||
<IconChevronLeft />
|
||||
</ActionIcon>
|
||||
<Title order={5}>Donasi</Title>
|
||||
<ActionIcon
|
||||
<ActionIcon disabled variant="transparent"/>
|
||||
{/* <ActionIcon
|
||||
radius={"md"}
|
||||
loading={isRightLoading ? true : false}
|
||||
variant="transparent"
|
||||
@@ -107,7 +98,7 @@ export default function LayoutDonasi({
|
||||
) : (
|
||||
<IconBell />
|
||||
)}
|
||||
</ActionIcon>
|
||||
</ActionIcon> */}
|
||||
</Group>
|
||||
</Header>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import { Model_Nama_Bank } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_DATA_BANK } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_IMAGES } from "@/app_modules/model_global/interface";
|
||||
|
||||
export interface MODEL_DONASI {
|
||||
|
||||
@@ -7,48 +7,25 @@ import { IconChevronRight } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||
import { useState } from "react";
|
||||
import { Model_Nama_Bank } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_DATA_BANK } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { Donasi_getNamaBank } from "../../fun/get/get_nama_bank";
|
||||
import { Donasi_funCreateInvoice } from "../../fun/create/fun_create_invoice";
|
||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
||||
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
||||
|
||||
const listBank = [
|
||||
{
|
||||
id: "1",
|
||||
norek: "345678765",
|
||||
bank: "BCA",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
norek: "4565435",
|
||||
bank: "BRI",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
norek: "423533424565",
|
||||
bank: "BNI",
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
norek: "8765423",
|
||||
bank: "MANDIRI",
|
||||
},
|
||||
];
|
||||
|
||||
export default function Donasi_MetodePembayaran({
|
||||
listBank,
|
||||
donasiId,
|
||||
authorId,
|
||||
}: {
|
||||
listBank: Model_Nama_Bank[];
|
||||
listBank: MODEL_DATA_BANK[];
|
||||
donasiId: string;
|
||||
authorId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
const [prosesDonasi, setProsesDonasi] = useAtom(gs_proses_donasi);
|
||||
const [pilihBank, setPilihBank] = useState("1");
|
||||
const [pilihBank, setPilihBank] = useState("");
|
||||
const [bank, setBank] = useState(listBank);
|
||||
|
||||
async function onProses() {
|
||||
@@ -82,7 +59,7 @@ export default function Donasi_MetodePembayaran({
|
||||
{/* <pre>{JSON.stringify(prosesDonasi, null, 2)}</pre> */}
|
||||
|
||||
<Radio.Group value={pilihBank} onChange={setPilihBank} withAsterisk>
|
||||
{bank.map((e) => (
|
||||
{bank.map((e, i) => (
|
||||
<Paper
|
||||
key={e.id}
|
||||
withBorder
|
||||
@@ -97,11 +74,15 @@ export default function Donasi_MetodePembayaran({
|
||||
</Radio.Group>
|
||||
|
||||
<Button
|
||||
disabled={pilihBank === "" ? true : false}
|
||||
style={{ transition: "0.5s" }}
|
||||
loaderPosition="center"
|
||||
loading={isLoading ? true : false}
|
||||
radius={"xl"}
|
||||
onClick={() => onProses()}
|
||||
onClick={() => {
|
||||
onProses();
|
||||
|
||||
}}
|
||||
>
|
||||
Pilih
|
||||
</Button>
|
||||
|
||||
@@ -31,8 +31,10 @@ import Link from "next/link";
|
||||
|
||||
export default function Donasi_ProsesTransaksi({
|
||||
dataInvoice,
|
||||
nomorAdmin,
|
||||
}: {
|
||||
dataInvoice: MODEL_DONASI_INVOICE;
|
||||
nomorAdmin: any
|
||||
}) {
|
||||
const [invoice, setInvoice] = useState(dataInvoice);
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_donasi_hot_menu);
|
||||
@@ -114,7 +116,7 @@ export default function Donasi_ProsesTransaksi({
|
||||
}}
|
||||
target="_blank"
|
||||
href={
|
||||
"https://wa.me/+6289697338821?text=Hallo Admin , Saya ada kendala dalam proses transfer donasi!"
|
||||
`https://wa.me/+${nomorAdmin.nomor}?text=Hallo Admin , Saya ada kendala dalam proses transfer donasi!`
|
||||
}
|
||||
>
|
||||
<IconBrandWhatsapp size={40} color={Warna.hijau_cerah} />
|
||||
|
||||
Reference in New Issue
Block a user