@@ -2,6 +2,9 @@
|
|||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"prisma": {
|
||||||
|
"seed": "npx tsx ./prisma/seed.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
|
|||||||
10
prisma/seed.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { generate_seeder } from "@/app_modules/_global/fun/generate_seeder";
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
console.log("start");
|
||||||
|
await generate_seeder();
|
||||||
|
})().finally(() => {
|
||||||
|
console.log("success");
|
||||||
|
prisma.$disconnect();
|
||||||
|
});
|
||||||
BIN
public/donasi/image/0aed0def-3278-41eb-be5c-9ba8f0ebdf6f.jpeg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
public/donasi/image/70df004f-eeb0-4469-8f76-41897e712d97.jpeg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/donasi/image/b832bd30-2c30-4fa2-b8bf-13ceebcbac1c.jpeg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/donasi/image/e85805b1-353d-4f5b-b016-226ba10e58c5.jpeg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/donasi/image/ebba534b-7a83-4e67-abac-08da8482fcde.jpeg
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 12 KiB |
BIN
public/donasi/invoice/49823a9a-0a6f-4098-85f9-25fa20b235e1.jpg
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
@@ -29,6 +29,7 @@ import nomor_admin from "../../../bin/seeder/nomor_admin.json";
|
|||||||
export async function GET(req: Request) {
|
export async function GET(req: Request) {
|
||||||
const dev = new URL(req.url).searchParams.get("dev");
|
const dev = new URL(req.url).searchParams.get("dev");
|
||||||
if (dev === "DEV-HIPMI") {
|
if (dev === "DEV-HIPMI") {
|
||||||
|
|
||||||
for (let i of userRole) {
|
for (let i of userRole) {
|
||||||
const data = await prisma.masterUserRole.upsert({
|
const data = await prisma.masterUserRole.upsert({
|
||||||
where: {
|
where: {
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,8 @@ import { DetailDraftDonasi } from "@/app_modules/donasi";
|
|||||||
import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
|
import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const dataDonasi = await Donasi_getOneById(params.id);
|
const donasiId = params.id
|
||||||
|
const dataDonasi = await Donasi_getOneById(donasiId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,6 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
// console.log(params.id)
|
// console.log(params.id)
|
||||||
const dataInvoice = await Donasi_getOneInvoiceById(params.id);
|
const dataInvoice = await Donasi_getOneInvoiceById(params.id);
|
||||||
const nomorAdmin = await donasi_getMasterNomorAdmin();
|
const nomorAdmin = await donasi_getMasterNomorAdmin();
|
||||||
console.log(nomorAdmin);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||||
import { Vote_MainDetail } from "@/app_modules/vote";
|
import { Vote_MainDetail } from "@/app_modules/vote";
|
||||||
import { Vote_cekKontributorById } from "@/app_modules/vote/fun/get/cek_kontributor_by_id";
|
import { Vote_cekKontributorById } from "@/app_modules/vote/fun/get/cek_kontributor_by_id";
|
||||||
import { Vote_getHasilVoteById } from "@/app_modules/vote/fun/get/get_list_hasil_by_id";
|
import { Vote_getHasilVoteById } from "@/app_modules/vote/fun/get/get_list_hasil_by_id";
|
||||||
@@ -12,7 +13,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
const isKontributor = await Vote_cekKontributorById(voteId);
|
const isKontributor = await Vote_cekKontributorById(voteId);
|
||||||
const pilihanKontributor = await Vote_getOnePilihanVotingByUserId(voteId);
|
const pilihanKontributor = await Vote_getOnePilihanVotingByUserId(voteId);
|
||||||
const listKontributor = await Vote_getListKontributorById(voteId);
|
const listKontributor = await Vote_getListKontributorById(voteId);
|
||||||
|
const userLoginId = await user_getOneUserId();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -22,6 +23,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
isKontributor={isKontributor}
|
isKontributor={isKontributor}
|
||||||
pilihanKontributor={pilihanKontributor as any}
|
pilihanKontributor={pilihanKontributor as any}
|
||||||
listKontributor={listKontributor as any}
|
listKontributor={listKontributor as any}
|
||||||
|
userLoginId={userLoginId}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
408
src/app_modules/_global/fun/generate_seeder.ts
Normal file
@@ -0,0 +1,408 @@
|
|||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import bidangBisnis from "../../../bin/seeder/bidang_bisnis.json";
|
||||||
|
import collaboration_industri from "../../../bin/seeder/colab/master_industri.json";
|
||||||
|
import collaboration_status from "../../../bin/seeder/colab/master_status.json";
|
||||||
|
import donasi_namaBank from "../../../bin/seeder/donasi/master_bank.json";
|
||||||
|
import donasi_durasi from "../../../bin/seeder/donasi/master_durasi.json";
|
||||||
|
import donasi_kategori from "../../../bin/seeder/donasi/master_kategori.json";
|
||||||
|
import donasi_status from "../../../bin/seeder/donasi/master_status.json";
|
||||||
|
import donasi_status_invoice from "../../../bin/seeder/donasi/master_status_invoice.json";
|
||||||
|
import event_status from "../../../bin/seeder/event/master_status.json";
|
||||||
|
import event_tipe_acara from "../../../bin/seeder/event/master_tipe_acara.json";
|
||||||
|
import forum_kategori_report from "../../../bin/seeder/forum/master_report.json";
|
||||||
|
import forum_status_posting from "../../../bin/seeder/forum/master_status.json";
|
||||||
|
import jenisProgres from "../../../bin/seeder/investasi/master_progres.json";
|
||||||
|
import namaBank from "../../../bin/seeder/investasi/nama_bank.json";
|
||||||
|
import pembagianDeviden from "../../../bin/seeder/investasi/pembagian_deviden.json";
|
||||||
|
import pencarianInvestor from "../../../bin/seeder/investasi/pencarian_investor.json";
|
||||||
|
import periodeDeviden from "../../../bin/seeder/investasi/periode_deviden.json";
|
||||||
|
import statusInvestasi from "../../../bin/seeder/investasi/status_investasi.json";
|
||||||
|
import statusTransaksiInvestasi from "../../../bin/seeder/investasi/status_transaksi_investasi.json";
|
||||||
|
import master_status from "../../../bin/seeder/master_status.json";
|
||||||
|
import nomor_admin from "../../../bin/seeder/nomor_admin.json";
|
||||||
|
import userRole from "../../../bin/seeder/user_role.json";
|
||||||
|
import userSeeder from "../../../bin/seeder/user_seeder.json";
|
||||||
|
import voting_status from "../../../bin/seeder/voting/master_status.json";
|
||||||
|
|
||||||
|
export async function generate_seeder() {
|
||||||
|
for (let i of userRole) {
|
||||||
|
await prisma.masterUserRole.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of userSeeder) {
|
||||||
|
await prisma.user.upsert({
|
||||||
|
where: {
|
||||||
|
nomor: i.nomor,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
nomor: i.nomor,
|
||||||
|
username: i.name,
|
||||||
|
masterUserRoleId: i.masterUserRoleId,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
nomor: i.nomor,
|
||||||
|
username: i.name,
|
||||||
|
masterUserRoleId: i.masterUserRoleId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of bidangBisnis) {
|
||||||
|
await prisma.masterBidangBisnis.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of pencarianInvestor) {
|
||||||
|
await prisma.masterPencarianInvestor.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of pembagianDeviden) {
|
||||||
|
await prisma.masterPembagianDeviden.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of periodeDeviden) {
|
||||||
|
await prisma.masterPeriodeDeviden.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of statusInvestasi) {
|
||||||
|
await prisma.masterStatusInvestasi.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id,
|
||||||
|
name: i.name,
|
||||||
|
color: i.color,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: i.id,
|
||||||
|
name: i.name,
|
||||||
|
color: i.color,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of namaBank) {
|
||||||
|
await prisma.masterBank.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
norek: i.norek.toString(),
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: i.id.toString(),
|
||||||
|
name: i.name,
|
||||||
|
norek: i.norek.toString(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of statusTransaksiInvestasi) {
|
||||||
|
await prisma.masterStatusTransaksiInvestasi.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id,
|
||||||
|
name: i.name,
|
||||||
|
color: i.color,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: i.id,
|
||||||
|
name: i.name,
|
||||||
|
color: i.color,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of jenisProgres) {
|
||||||
|
await prisma.masterProgresInvestasi.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id,
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: i.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let d of donasi_status) {
|
||||||
|
await prisma.donasiMaster_StatusDonasi.upsert({
|
||||||
|
where: {
|
||||||
|
id: d.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: d.id,
|
||||||
|
name: d.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: d.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let d of donasi_kategori) {
|
||||||
|
await prisma.donasiMaster_Kategori.upsert({
|
||||||
|
where: {
|
||||||
|
id: d.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: d.id,
|
||||||
|
name: d.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: d.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let d of donasi_durasi) {
|
||||||
|
await prisma.donasiMaster_Durasi.upsert({
|
||||||
|
where: {
|
||||||
|
id: d.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: d.id,
|
||||||
|
name: d.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: d.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i of donasi_namaBank) {
|
||||||
|
await prisma.donasiMaster_Bank.upsert({
|
||||||
|
where: {
|
||||||
|
id: i.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: i.id,
|
||||||
|
name: i.name,
|
||||||
|
norek: i.norek,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: i.id,
|
||||||
|
name: i.name,
|
||||||
|
norek: i.norek,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let d of donasi_status_invoice) {
|
||||||
|
await prisma.donasiMaster_StatusInvoice.upsert({
|
||||||
|
where: {
|
||||||
|
id: d.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: d.id,
|
||||||
|
name: d.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: d.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let e of event_status) {
|
||||||
|
await prisma.eventMaster_Status.upsert({
|
||||||
|
where: {
|
||||||
|
id: e.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: e.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let e of event_tipe_acara) {
|
||||||
|
await prisma.eventMaster_TipeAcara.upsert({
|
||||||
|
where: {
|
||||||
|
id: e.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: e.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let v of voting_status) {
|
||||||
|
await prisma.voting_Status.upsert({
|
||||||
|
where: {
|
||||||
|
id: v.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: v.id,
|
||||||
|
name: v.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: v.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let m of master_status) {
|
||||||
|
await prisma.masterStatus.upsert({
|
||||||
|
where: {
|
||||||
|
id: m.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: m.id,
|
||||||
|
name: m.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: m.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let m of forum_kategori_report) {
|
||||||
|
await prisma.forumMaster_KategoriReport.upsert({
|
||||||
|
where: {
|
||||||
|
id: m.id as number,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
title: m.title,
|
||||||
|
deskripsi: m.deskripsi,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
title: m.title,
|
||||||
|
deskripsi: m.deskripsi,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let s of forum_status_posting) {
|
||||||
|
await prisma.forumMaster_StatusPosting.upsert({
|
||||||
|
where: {
|
||||||
|
id: s.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
status: s.status,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
status: s.status,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let p of collaboration_industri) {
|
||||||
|
await prisma.projectCollaborationMaster_Industri.upsert({
|
||||||
|
where: {
|
||||||
|
id: p.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: p.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: p.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let p of collaboration_status) {
|
||||||
|
await prisma.projectCollaborationMaster_Status.upsert({
|
||||||
|
where: {
|
||||||
|
id: p.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: p.name,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: p.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let a of nomor_admin) {
|
||||||
|
await prisma.nomorAdmin.upsert({
|
||||||
|
where: {
|
||||||
|
id: a.id,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: a.id,
|
||||||
|
nomor: a.nomor,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
id: a.id,
|
||||||
|
nomor: a.nomor,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return { status: 200, success: true };
|
||||||
|
}
|
||||||
@@ -21,7 +21,9 @@ export async function ComponentGlobal_NotifikasiBerhasil(
|
|||||||
return notifications.show({
|
return notifications.show({
|
||||||
message: (
|
message: (
|
||||||
<Center>
|
<Center>
|
||||||
<Text fw={"bold"}>{text}</Text>
|
<Text align="center" fw={"bold"}>
|
||||||
|
{text}
|
||||||
|
</Text>
|
||||||
</Center>
|
</Center>
|
||||||
),
|
),
|
||||||
color: "green",
|
color: "green",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export async function ComponentGlobal_NotifikasiGagal(text: string) {
|
|||||||
return notifications.show({
|
return notifications.show({
|
||||||
message: (
|
message: (
|
||||||
<Center>
|
<Center>
|
||||||
<Text fw={"bold"}>{text}</Text>
|
<Text align="center" fw={"bold"}>{text}</Text>
|
||||||
</Center>
|
</Center>
|
||||||
),
|
),
|
||||||
color: "red",
|
color: "red",
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ export async function ComponentGlobal_NotifikasiPeringatan(
|
|||||||
return notifications.show({
|
return notifications.show({
|
||||||
message: (
|
message: (
|
||||||
<Center>
|
<Center>
|
||||||
<Text fw={"bold"}>{text}</Text>
|
<Text align="center" fw={"bold"}>
|
||||||
|
{text}
|
||||||
|
</Text>
|
||||||
</Center>
|
</Center>
|
||||||
),
|
),
|
||||||
color: "yellow.1",
|
color: "yellow.1",
|
||||||
@@ -24,9 +26,7 @@ export async function ComponentGlobal_NotifikasiPeringatan(
|
|||||||
style: {
|
style: {
|
||||||
borderWidth: "0.5px",
|
borderWidth: "0.5px",
|
||||||
borderStyle: "solid",
|
borderStyle: "solid",
|
||||||
borderColor: "red"
|
borderColor: "red",
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
icon: (
|
icon: (
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import adminNotifikasi_getByUserId from "./notifikasi/fun/get/get_notifikasi_by_
|
|||||||
import adminNotifikasi_funUpdateIsReadById from "./notifikasi/fun/update/fun_update_is_read_by_id";
|
import adminNotifikasi_funUpdateIsReadById from "./notifikasi/fun/update/fun_update_is_read_by_id";
|
||||||
import adminNotifikasi_findRouterJob from "./notifikasi/route_setting/job";
|
import adminNotifikasi_findRouterJob from "./notifikasi/route_setting/job";
|
||||||
import adminNotifikasi_findRouterForum from "./notifikasi/route_setting/forum";
|
import adminNotifikasi_findRouterForum from "./notifikasi/route_setting/forum";
|
||||||
|
import { adminNotifikasi_findRouterVoting } from "./notifikasi/route_setting/voting";
|
||||||
|
|
||||||
export default function AdminLayout({
|
export default function AdminLayout({
|
||||||
children,
|
children,
|
||||||
@@ -297,6 +298,7 @@ export default function AdminLayout({
|
|||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppShell>
|
</AppShell>
|
||||||
|
|
||||||
{/* Drawer Mobile View */}
|
{/* Drawer Mobile View */}
|
||||||
<Drawer opened={opened} onClose={() => setOpened(false)} size={"50%"}>
|
<Drawer opened={opened} onClose={() => setOpened(false)} size={"50%"}>
|
||||||
<Stack spacing={"xl"}>
|
<Stack spacing={"xl"}>
|
||||||
@@ -389,6 +391,7 @@ function DrawerNotifikasi({
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
// JOB
|
||||||
e?.kategoriApp === "JOB" &&
|
e?.kategoriApp === "JOB" &&
|
||||||
adminNotifikasi_findRouterJob({
|
adminNotifikasi_findRouterJob({
|
||||||
data: e,
|
data: e,
|
||||||
@@ -399,6 +402,7 @@ function DrawerNotifikasi({
|
|||||||
onToggleNavbar: onToggleNavbar,
|
onToggleNavbar: onToggleNavbar,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// FORUM
|
||||||
e?.kategoriApp === "FORUM" &&
|
e?.kategoriApp === "FORUM" &&
|
||||||
adminNotifikasi_findRouterForum({
|
adminNotifikasi_findRouterForum({
|
||||||
data: e,
|
data: e,
|
||||||
@@ -411,6 +415,19 @@ function DrawerNotifikasi({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// VOTE
|
||||||
|
e?.kategoriApp === "VOTING" &&
|
||||||
|
adminNotifikasi_findRouterVoting({
|
||||||
|
data: e,
|
||||||
|
router: router,
|
||||||
|
onChangeNavbar(val) {
|
||||||
|
onChangeNavbar(val);
|
||||||
|
},
|
||||||
|
onToggleNavbar(val) {
|
||||||
|
onToggleNavbar(val);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const updateIsRead = await adminNotifikasi_funUpdateIsReadById({
|
const updateIsRead = await adminNotifikasi_funUpdateIsReadById({
|
||||||
notifId: e?.id,
|
notifId: e?.id,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
|
||||||
Box,
|
|
||||||
Center,
|
|
||||||
Divider,
|
Divider,
|
||||||
Grid,
|
Grid,
|
||||||
Group,
|
Group,
|
||||||
Paper,
|
Paper,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
Title,
|
Title
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import Admin_Investasi from "../../investasi/main/view";
|
|
||||||
import { IconChevronsRight } from "@tabler/icons-react";
|
|
||||||
import router from "next/router";
|
|
||||||
import * as echarts from 'echarts';
|
|
||||||
import EChartsReact from "echarts-for-react";
|
|
||||||
|
|
||||||
|
|
||||||
export default function AdminMain({countUser, countPorto}: {countUser: number, countPorto: number} ) {
|
export default function AdminMain({countUser, countPorto}: {countUser: number, countPorto: number} ) {
|
||||||
|
|||||||
@@ -8,10 +8,14 @@ export default async function adminNotifikasi_getByUserId() {
|
|||||||
const adminId = await user_getOneUserId();
|
const adminId = await user_getOneUserId();
|
||||||
|
|
||||||
const data = await prisma.notifikasi.findMany({
|
const data = await prisma.notifikasi.findMany({
|
||||||
|
orderBy: [
|
||||||
orderBy: {
|
{
|
||||||
createdAt: "desc",
|
isRead: "asc",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
],
|
||||||
where: {
|
where: {
|
||||||
adminId: adminId,
|
adminId: adminId,
|
||||||
userRoleId: "2",
|
userRoleId: "2",
|
||||||
|
|||||||
27
src/app_modules/admin/notifikasi/route_setting/voting.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
|
||||||
|
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||||
|
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||||
|
|
||||||
|
export async function adminNotifikasi_findRouterVoting({
|
||||||
|
data,
|
||||||
|
router,
|
||||||
|
onChangeNavbar,
|
||||||
|
onToggleNavbar,
|
||||||
|
}: {
|
||||||
|
data: MODEL_NOTIFIKASI;
|
||||||
|
router: AppRouterInstance;
|
||||||
|
onChangeNavbar: (val: any) => void;
|
||||||
|
onToggleNavbar: (val: any) => void;
|
||||||
|
}) {
|
||||||
|
const path = RouterAdminVote.table_review;
|
||||||
|
|
||||||
|
if (data.status === "Review") {
|
||||||
|
router.push(path, { scroll: false });
|
||||||
|
onChangeNavbar({
|
||||||
|
id: 5,
|
||||||
|
childId: 53,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onToggleNavbar(true);
|
||||||
|
}
|
||||||
@@ -1,19 +1,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate";
|
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate";
|
||||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
|
||||||
import { MODEL_VOTING } from "@/app_modules/vote/model/interface";
|
import { MODEL_VOTING } from "@/app_modules/vote/model/interface";
|
||||||
import {
|
import {
|
||||||
Avatar,
|
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
Divider,
|
|
||||||
Grid,
|
|
||||||
Group,
|
Group,
|
||||||
Modal,
|
Modal,
|
||||||
Paper,
|
|
||||||
ScrollArea,
|
ScrollArea,
|
||||||
Spoiler,
|
Spoiler,
|
||||||
Stack,
|
Stack,
|
||||||
@@ -23,20 +17,20 @@ import {
|
|||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
import { IconBan } from "@tabler/icons-react";
|
import { IconBan, IconEyeShare } from "@tabler/icons-react";
|
||||||
import { IconEyeShare } from "@tabler/icons-react";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { useState } from "react";
|
|
||||||
import { AdminVote_funEditStatusPublishById } from "../../fun/edit/fun_edit_status_publish_by_id";
|
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
import { AdminVote_getListTableByStatusId } from "../../fun/get/get_list_table_by_status_id";
|
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import { AdminEvent_funEditCatatanById } from "../../fun/edit/fun_edit_status_reject_by_id";
|
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { AdminVote_funEditStatusPublishById } from "../../fun/edit/fun_edit_status_publish_by_id";
|
||||||
|
import { AdminEvent_funEditCatatanById } from "../../fun/edit/fun_edit_status_reject_by_id";
|
||||||
|
import { AdminVote_getListTableByStatusId } from "../../fun/get/get_list_table_by_status_id";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user";
|
||||||
|
|
||||||
export default function AdminVote_TableReview({
|
export default function AdminVote_TableReview({
|
||||||
listVote,
|
listVote,
|
||||||
@@ -255,17 +249,36 @@ async function onPublish(
|
|||||||
return ComponentGlobal_NotifikasiPeringatan("Tanggal Voting Lewat");
|
return ComponentGlobal_NotifikasiPeringatan("Tanggal Voting Lewat");
|
||||||
|
|
||||||
setVotingId(voteId);
|
setVotingId(voteId);
|
||||||
await AdminVote_funEditStatusPublishById(voteId).then(async (res) => {
|
const res = await AdminVote_funEditStatusPublishById(voteId);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
await AdminVote_getListTableByStatusId("2").then((val) => {
|
const dataNotif = {
|
||||||
setData(val);
|
appId: res.data?.id,
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
status: res.data?.Voting_Status?.name as any,
|
||||||
setLoadingPublish(true);
|
userId: res.data?.authorId as any,
|
||||||
});
|
pesan: res.data?.title as any,
|
||||||
} else {
|
kategoriApp: "VOTING",
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
title: "Voting publish",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await adminNotifikasi_funCreateToUser({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({ userId: res?.data?.authorId, count: 1 })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
await AdminVote_getListTableByStatusId("2").then((val) => {
|
||||||
|
setData(val);
|
||||||
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
setLoadingPublish(true);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onReject(
|
async function onReject(
|
||||||
@@ -279,16 +292,36 @@ async function onReject(
|
|||||||
id: voteId,
|
id: voteId,
|
||||||
catatan: catatan,
|
catatan: catatan,
|
||||||
};
|
};
|
||||||
await AdminEvent_funEditCatatanById(data as any).then(async (res) => {
|
|
||||||
if (res.status === 200) {
|
const res = await AdminEvent_funEditCatatanById(data as any);
|
||||||
await AdminVote_getListTableByStatusId("2").then((val) => {
|
if (res.status === 200) {
|
||||||
setData(val);
|
const dataNotif = {
|
||||||
setSaveLoading(true);
|
appId: res.data?.id,
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
status: res.data?.Voting_Status?.name as any,
|
||||||
close();
|
userId: res.data?.authorId as any,
|
||||||
});
|
pesan: res.data?.title as any,
|
||||||
} else {
|
kategoriApp: "VOTING",
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
title: "Voting anda di tolak !",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await adminNotifikasi_funCreateToUser({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({ userId: res?.data?.authorId, count: 1 })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
await AdminVote_getListTableByStatusId("2").then((val) => {
|
||||||
|
setData(val);
|
||||||
|
setSaveLoading(true);
|
||||||
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
close();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,20 +4,31 @@ import prisma from "@/app/lib/prisma";
|
|||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function AdminVote_funEditStatusPublishById(voteId: string) {
|
export async function AdminVote_funEditStatusPublishById(voteId: string) {
|
||||||
|
const updt = await prisma.voting.update({
|
||||||
const updt = await prisma.voting.update({
|
where: {
|
||||||
where: {
|
id: voteId,
|
||||||
id: voteId,
|
},
|
||||||
|
data: {
|
||||||
|
voting_StatusId: "1",
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
Voting_Status: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data: {
|
},
|
||||||
voting_StatusId: "1",
|
});
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!updt) return { status: 400, message: "Update Gagal" };
|
if (!updt) return { status: 400, message: "Update Gagal" };
|
||||||
revalidatePath("/dev/admin/vote/main");
|
revalidatePath("/dev/admin/vote/main");
|
||||||
return {
|
|
||||||
status: 200,
|
return {
|
||||||
message: "Berhasil Update Status",
|
data: updt,
|
||||||
};
|
status: 200,
|
||||||
|
message: "Berhasil Update Status",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,22 @@ export async function AdminEvent_funEditCatatanById(
|
|||||||
voting_StatusId: "4",
|
voting_StatusId: "4",
|
||||||
catatan: data.catatan,
|
catatan: data.catatan,
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
Voting_Status: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!updt) return { status: 400, message: "Update Gagal" };
|
if (!updt) return { status: 400, message: "Update Gagal" };
|
||||||
revalidatePath("/dev/admin/event/main");
|
revalidatePath("/dev/admin/event/main");
|
||||||
return {
|
return {
|
||||||
|
data: updt,
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Berhasil Update Status",
|
message: "Berhasil Update Status",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import _ from "lodash";
|
|||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
|
||||||
export default function Colab_Create({
|
export default function Colab_Create({
|
||||||
listIndustri,
|
listIndustri,
|
||||||
@@ -184,18 +185,24 @@ function ButtonAction({ value }: { value: any }) {
|
|||||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||||
if (value.projectCollaborationMaster_IndustriId === 0)
|
if (value.projectCollaborationMaster_IndustriId === 0)
|
||||||
return ComponentGlobal_NotifikasiPeringatan("Pilih Industri");
|
return ComponentGlobal_NotifikasiPeringatan("Pilih Industri");
|
||||||
// if (value.jumlah_partisipan < 2)
|
|
||||||
// return ComponentGlobal_NotifikasiPeringatan("Minimal Ada 2 Partisipan");
|
|
||||||
|
|
||||||
await colab_funCreateProyek(value).then((res) => {
|
const res = await colab_funCreateProyek(value);
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
setLoading(true);
|
// const dataNotif: any = {
|
||||||
router.back();
|
// appId: res.data?.id as any,
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
// kategoriApp: "VOTING",
|
||||||
} else {
|
// status: create.data?.MasterStatus?.name as any,
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
// userId: create.data?.authorId as any,
|
||||||
}
|
// pesan: create.data?.title as any,
|
||||||
});
|
// title: "Job baru",
|
||||||
|
// };
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
router.back();
|
||||||
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(value);
|
// console.log(value);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default async function colab_funCreateProyek(
|
|||||||
) {
|
) {
|
||||||
const AuthorId = await user_getOneUserId();
|
const AuthorId = await user_getOneUserId();
|
||||||
|
|
||||||
const create = await prisma.projectCollaboration.create({
|
const data = await prisma.projectCollaboration.create({
|
||||||
data: {
|
data: {
|
||||||
title: value.title,
|
title: value.title,
|
||||||
lokasi: value.lokasi,
|
lokasi: value.lokasi,
|
||||||
@@ -25,7 +25,7 @@ export default async function colab_funCreateProyek(
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!create) return { status: 400, message: "Gagal Membuat Proyek" };
|
if (!data) return { status: 400, message: "Gagal Membuat Proyek" };
|
||||||
revalidatePath(RouterColab.beranda);
|
revalidatePath(RouterColab.beranda);
|
||||||
return { status: 201, message: "Berhasil Membuar Proyek" };
|
return { data, status: 201, message: "Berhasil Membuar Proyek" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import { useRouter } from "next/navigation";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function LayoutMainCrowd({
|
export default function LayoutMainCrowd({
|
||||||
@@ -10,19 +10,18 @@ export default function LayoutMainCrowd({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={
|
header={
|
||||||
<ComponentGlobal_HeaderTamplate
|
<UIGlobal_LayoutHeaderTamplate
|
||||||
route="/dev/home"
|
title="Crowd Funding"
|
||||||
title="HIPMI Crowd Funding"
|
routerLeft={RouterHome.main_home}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
|
import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
|
||||||
import { Warna } from "@/app/lib/warna";
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||||
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import { gs_donasi_hot_menu } from "@/app_modules/donasi/global_state";
|
import { gs_donasi_hot_menu } from "@/app_modules/donasi/global_state";
|
||||||
import { gs_investasiFooter } from "@/app_modules/investasi/g_state";
|
import { gs_investasiFooter } from "@/app_modules/investasi/g_state";
|
||||||
import {
|
import {
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Button,
|
|
||||||
Center,
|
|
||||||
Flex,
|
|
||||||
Grid,
|
Grid,
|
||||||
Image,
|
Image,
|
||||||
Loader,
|
Loader,
|
||||||
@@ -21,7 +23,6 @@ import { IconChevronRight } from "@tabler/icons-react";
|
|||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
|
|
||||||
export default function MainCrowd() {
|
export default function MainCrowd() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -29,26 +30,46 @@ export default function MainCrowd() {
|
|||||||
const [donasiHotMenu, setDonasiHotMenu] = useAtom(gs_donasi_hot_menu);
|
const [donasiHotMenu, setDonasiHotMenu] = useAtom(gs_donasi_hot_menu);
|
||||||
const [loadingInv, setLoadingInv] = useState(false);
|
const [loadingInv, setLoadingInv] = useState(false);
|
||||||
const [loadingDon, setLoadingDon] = useState(false);
|
const [loadingDon, setLoadingDon] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Paper>
|
<Paper>
|
||||||
<AspectRatio ratio={16 / 9}>
|
{/* <AspectRatio ratio={16 / 9}>
|
||||||
<Paper radius={"md"}>
|
<Paper radius={"md"}>
|
||||||
<Image alt="" src={"/aset/investasi/logo-crowd-panjang.png"} />
|
|
||||||
</Paper>
|
</Paper>
|
||||||
</AspectRatio>
|
</AspectRatio> */}
|
||||||
|
<Image
|
||||||
|
alt="Logo"
|
||||||
|
src={"/aset/investasi/logo-crowd-panjang.png"}
|
||||||
|
mah={"100%"}
|
||||||
|
styles={{
|
||||||
|
image: {
|
||||||
|
borderRadius: "20px",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
<Stack>
|
<Stack>
|
||||||
|
{/* INVESTASI */}
|
||||||
<Paper
|
<Paper
|
||||||
shadow="lg"
|
style={{
|
||||||
p={"md"}
|
cursor: "pointer",
|
||||||
radius={"md"}
|
padding: "15px",
|
||||||
bg={"teal.4"}
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
borderRadius: "10px",
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoadingInv(true);
|
// setLoadingInv(true);
|
||||||
router.push(RouterCrowd.investasi);
|
// router.push(RouterCrowd.investasi);
|
||||||
setChangeColor(0);
|
// setChangeColor(0);
|
||||||
|
ComponentGlobal_NotifikasiPeringatan(
|
||||||
|
"Sementara ini sedang maintenance",
|
||||||
|
3000
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -61,20 +82,34 @@ export default function MainCrowd() {
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Stack h={"100%"} justify="center" align="center">
|
<Stack h={"100%"} justify="center" align="center">
|
||||||
{loadingInv ? <Loader /> : <IconChevronRight />}
|
{loadingInv ? (
|
||||||
|
<ComponentGlobal_Loader />
|
||||||
|
) : (
|
||||||
|
<IconChevronRight />
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
|
{/* DONASI */}
|
||||||
<Paper
|
<Paper
|
||||||
shadow="lg"
|
style={{
|
||||||
bg={"blue.3"}
|
cursor: "pointer",
|
||||||
radius={"md"}
|
padding: "15px",
|
||||||
p={"md"}
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
borderRadius: "10px",
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoadingDon(true);
|
// setLoadingDon(true);
|
||||||
router.push(RouterCrowd.donasi);
|
// router.push(RouterCrowd.donasi);
|
||||||
setDonasiHotMenu(0);
|
// setDonasiHotMenu(0);
|
||||||
|
ComponentGlobal_NotifikasiPeringatan(
|
||||||
|
"Sementara ini sedang maintenance",
|
||||||
|
3000
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -87,7 +122,11 @@ export default function MainCrowd() {
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Stack h={"100%"} justify="center" align="center">
|
<Stack h={"100%"} justify="center" align="center">
|
||||||
{loadingDon ? <Loader /> : <IconChevronRight />}
|
{loadingDon ? (
|
||||||
|
<ComponentGlobal_Loader />
|
||||||
|
) : (
|
||||||
|
<IconChevronRight />
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -1,23 +1,20 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Warna } from "@/app/lib/warna";
|
import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
|
||||||
import { Center, Image, Paper, Stack, Text, Title } from "@mantine/core";
|
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
|
import { IconHeartHandshake } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
export default function SplashCrowd() {
|
export default function SplashCrowd() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
setTimeout(() => router.push("/dev/crowd/main"), 1000);
|
setTimeout(() => router.push(RouterCrowd.main), 1000);
|
||||||
}, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Center h={"100vh"}>
|
<UIGlobal_SplashScreen icon={<IconHeartHandshake size={300} />} />
|
||||||
<Paper p={{ base: 50, md: 60, lg: 80 }}>
|
|
||||||
<Image alt="" src={"/aset/investasi/logo-crowd.png"} />
|
|
||||||
</Paper>
|
|
||||||
</Center>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,100 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
|
||||||
import {
|
|
||||||
SimpleGrid,
|
|
||||||
Box,
|
|
||||||
Stack,
|
|
||||||
Grid,
|
|
||||||
AspectRatio,
|
|
||||||
Paper,
|
|
||||||
Progress,
|
|
||||||
Divider,
|
|
||||||
Image,
|
|
||||||
Text,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import router from "next/router";
|
|
||||||
import ComponentDonasi_TampilanHitungMundur from "./tampilan_hitung_mundur";
|
|
||||||
import TampilanRupiahDonasi from "./tampilan_rupiah";
|
|
||||||
import { MODEL_DONASI } from "../model/interface";
|
|
||||||
import { useViewportSize } from "@mantine/hooks";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { useState } from "react";
|
|
||||||
import _ from "lodash";
|
|
||||||
import ComponentDonasi_IsEmptyData from "./is_empty_data";
|
|
||||||
|
|
||||||
export default function ComponentDonasi_BoxPublish({
|
|
||||||
dataDonasi,
|
|
||||||
path,
|
|
||||||
}: {
|
|
||||||
dataDonasi: MODEL_DONASI[];
|
|
||||||
path: string;
|
|
||||||
}) {
|
|
||||||
const { height, width } = useViewportSize();
|
|
||||||
const router = useRouter();
|
|
||||||
const [donasi, setDonasi] = useState(dataDonasi);
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{_.isEmpty(dataDonasi) ? (
|
|
||||||
<ComponentDonasi_IsEmptyData text="Tidak ada data" />
|
|
||||||
) : (
|
|
||||||
<SimpleGrid
|
|
||||||
cols={4}
|
|
||||||
spacing="lg"
|
|
||||||
breakpoints={[
|
|
||||||
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
|
||||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
{donasi.map((e, i) => (
|
|
||||||
<Box
|
|
||||||
key={i}
|
|
||||||
onClick={() => {
|
|
||||||
router.push(path + `${e.id}`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={7}>
|
|
||||||
<AspectRatio ratio={16 / 9}>
|
|
||||||
<Paper radius={"md"}>
|
|
||||||
<Image
|
|
||||||
alt="Foto"
|
|
||||||
src={RouterDonasi.api_gambar + `${e.imagesId}`}
|
|
||||||
radius={"md"}
|
|
||||||
/>
|
|
||||||
</Paper>
|
|
||||||
</AspectRatio>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={5}>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Stack spacing={0}>
|
|
||||||
<Text fz={"sm"} fw={"bold"} lineClamp={2}>
|
|
||||||
{e.title}
|
|
||||||
</Text>
|
|
||||||
<ComponentDonasi_TampilanHitungMundur
|
|
||||||
durasi={e.DonasiMaster_Durasi.name}
|
|
||||||
publishTime={e.publishTime}
|
|
||||||
textSize={10}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Progress value={+e.progres} color="orange" />
|
|
||||||
<Stack spacing={0}>
|
|
||||||
<Text fz={"sm"}>Terkumpul</Text>
|
|
||||||
<Text fz={"sm"} fw={"bold"} c={"orange"} truncate>
|
|
||||||
<TampilanRupiahDonasi nominal={+e.terkumpul} />
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
{width > 575 ? "" : <Divider />}
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
))}
|
|
||||||
</SimpleGrid>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
84
src/app_modules/donasi/component/card_view/box_publish.tsx
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import {
|
||||||
|
AspectRatio,
|
||||||
|
Box,
|
||||||
|
Grid,
|
||||||
|
Image,
|
||||||
|
Paper,
|
||||||
|
Progress,
|
||||||
|
Stack,
|
||||||
|
Text
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import ComponentDonasi_TampilanHitungMundur from "../tampilan_hitung_mundur";
|
||||||
|
import TampilanRupiahDonasi from "../tampilan_rupiah";
|
||||||
|
|
||||||
|
export default function ComponentDonasi_CardPublish({
|
||||||
|
data,
|
||||||
|
path,
|
||||||
|
}: {
|
||||||
|
data: any;
|
||||||
|
path: string;
|
||||||
|
}) {
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
borderRadius: "10px",
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
router.push(path + `${data.id}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Stack>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={7}>
|
||||||
|
<AspectRatio ratio={16 / 9}>
|
||||||
|
<Paper radius={"md"}>
|
||||||
|
<Image
|
||||||
|
alt="Foto"
|
||||||
|
src={RouterDonasi.api_gambar + `${data.imagesId}`}
|
||||||
|
radius={"xs"}
|
||||||
|
/>
|
||||||
|
</Paper>
|
||||||
|
</AspectRatio>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={5}>
|
||||||
|
<Stack spacing={"xs"}>
|
||||||
|
<Stack spacing={0}>
|
||||||
|
<Text fz={"sm"} fw={"bold"} lineClamp={2}>
|
||||||
|
{data.title}
|
||||||
|
</Text>
|
||||||
|
<ComponentDonasi_TampilanHitungMundur
|
||||||
|
durasi={data?.DonasiMaster_Durasi?.name}
|
||||||
|
publishTime={data.publishTime}
|
||||||
|
textSize={10}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
<Progress value={+data.progres} color="yellow" />
|
||||||
|
<Stack spacing={0}>
|
||||||
|
<Text fz={"sm"}>Terkumpul</Text>
|
||||||
|
<Text fz={"sm"} fw={"bold"} c={"orange"} truncate>
|
||||||
|
<TampilanRupiahDonasi nominal={+data.terkumpul} />
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
{/* {width > 575 ? "" : <Divider />} */}
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
71
src/app_modules/donasi/component/card_view/card_status.tsx
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import {
|
||||||
|
Box,
|
||||||
|
Stack,
|
||||||
|
Grid,
|
||||||
|
AspectRatio,
|
||||||
|
Paper,
|
||||||
|
Image,
|
||||||
|
Text,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
|
|
||||||
|
export function ComponentDonasi_CardStatus({
|
||||||
|
data,
|
||||||
|
path,
|
||||||
|
}: {
|
||||||
|
data: MODEL_DONASI;
|
||||||
|
path: string;
|
||||||
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
borderRadius: "10px",
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
|
onClick={() => router.push(path + `${data.id}`)}
|
||||||
|
>
|
||||||
|
<Stack>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={7}>
|
||||||
|
<AspectRatio ratio={16 / 9}>
|
||||||
|
<Paper radius={"sm"} bg={"gray.1"}>
|
||||||
|
<Image
|
||||||
|
alt="Foto"
|
||||||
|
src={RouterDonasi.api_gambar + `${data.imagesId}`}
|
||||||
|
radius={"md"}
|
||||||
|
/>
|
||||||
|
</Paper>
|
||||||
|
</AspectRatio>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={5}>
|
||||||
|
<Stack spacing={"xs"}>
|
||||||
|
<Text fz={"sm"} fw={"bold"} lineClamp={2}>
|
||||||
|
{data.title}
|
||||||
|
</Text>
|
||||||
|
<Stack spacing={0}>
|
||||||
|
<Text fz={"sm"}>Terget Dana</Text>
|
||||||
|
<Text fz={"sm"} fw={"bold"} c={"yellow"} lineClamp={1}>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+data.target)}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
{/* {width > 575 ? "" : <Divider />} */}
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import TampilanRupiahDonasi from "../tampilan_rupiah";
|
import TampilanRupiahDonasi from "../tampilan_rupiah";
|
||||||
|
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function ComponentDonasi_DetailDataGalangDana({
|
export default function ComponentDonasi_DetailDataGalangDana({
|
||||||
donasi,
|
donasi,
|
||||||
@@ -22,14 +23,30 @@ export default function ComponentDonasi_DetailDataGalangDana({
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack px={"xs"}>
|
<Stack
|
||||||
|
style={{
|
||||||
|
paddingInline: "15px",
|
||||||
|
paddingBottom: "15px",
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Image
|
<AspectRatio
|
||||||
alt="Foto"
|
ratio={9 / 16}
|
||||||
src={RouterDonasi.api_gambar + `${donasi.imagesId}`}
|
mx={"sm"}
|
||||||
/>
|
mah={300}
|
||||||
{/* <AspectRatio ratio={9 / 16} maw={500} mah={1000} bg={"blue"}>
|
// bg={"blue"}
|
||||||
</AspectRatio> */}
|
style={{}}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
alt="Foto"
|
||||||
|
src={RouterDonasi.api_image + `${donasi.imageDonasi.url}`}
|
||||||
|
radius={"sm"}
|
||||||
|
/>
|
||||||
|
</AspectRatio>
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Title order={4}>{donasi.title}</Title>
|
<Title order={4}>{donasi.title}</Title>
|
||||||
<Text fz={10}>Durasi: {donasi.DonasiMaster_Durasi.name} hari</Text>
|
<Text fz={10}>Durasi: {donasi.DonasiMaster_Durasi.name} hari</Text>
|
||||||
@@ -38,13 +55,17 @@ export default function ComponentDonasi_DetailDataGalangDana({
|
|||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text fz={12}>Dana dibutuhkan</Text>
|
<Text fz={12}>Dana dibutuhkan</Text>
|
||||||
<Title order={4} c="blue">
|
<Title order={4} style={{
|
||||||
|
color: MainColor.yellow
|
||||||
|
}}>
|
||||||
<TampilanRupiahDonasi nominal={+donasi.target} />
|
<TampilanRupiahDonasi nominal={+donasi.target} />
|
||||||
</Title>
|
</Title>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text fz={12}>Kategori</Text>
|
<Text fz={12}>Kategori</Text>
|
||||||
<Title order={4} c="blue">
|
<Title order={4} style={{
|
||||||
|
color: MainColor.yellow
|
||||||
|
}}>
|
||||||
{donasi.DonasiMaster_Ketegori.name}
|
{donasi.DonasiMaster_Ketegori.name}
|
||||||
</Title>
|
</Title>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -7,6 +7,11 @@ import { Stack, Title, Paper, Group, ActionIcon, Text } from "@mantine/core";
|
|||||||
import { IconCircleChevronRight } from "@tabler/icons-react";
|
import { IconCircleChevronRight } from "@tabler/icons-react";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||||
|
|
||||||
export default function ComponentDonasi_CeritaPenggalangMain({
|
export default function ComponentDonasi_CeritaPenggalangMain({
|
||||||
donasi,
|
donasi,
|
||||||
@@ -17,9 +22,22 @@ export default function ComponentDonasi_CeritaPenggalangMain({
|
|||||||
const [isLoading, setLoading] = useState(false);
|
const [isLoading, setLoading] = useState(false);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xs"}>
|
<Stack
|
||||||
|
spacing={"xs"}
|
||||||
|
style={{
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Title order={4}>Cerita Penggalang Dana</Title>
|
<Title order={4}>Cerita Penggalang Dana</Title>
|
||||||
<Paper p={"sm"} withBorder>
|
<Paper
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Text>
|
<Text>
|
||||||
@@ -28,14 +46,21 @@ export default function ComponentDonasi_CeritaPenggalangMain({
|
|||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
loading={isLoading ? true : false}
|
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
router.push(RouterDonasi.cerita_penggalang + `${donasi.id}`);
|
router.push(RouterDonasi.cerita_penggalang + `${donasi.id}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconCircleChevronRight />
|
{isLoading ? (
|
||||||
|
<ComponentGlobal_Loader />
|
||||||
|
) : (
|
||||||
|
<IconCircleChevronRight
|
||||||
|
style={{
|
||||||
|
color: MainColor.yellow,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Group>
|
</Group>
|
||||||
<Text lineClamp={4}>{donasi.CeritaDonasi.cerita}</Text>
|
<Text lineClamp={4}>{donasi.CeritaDonasi.cerita}</Text>
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ import { NotifBerhasil } from "../notifikasi/notif_berhasil";
|
|||||||
import { Donasi_findDonaturByTokenId } from "../../fun/get/get_donatur_by_token_id";
|
import { Donasi_findDonaturByTokenId } from "../../fun/get/get_donatur_by_token_id";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentGlobal_CardLoadingOverlay from "@/app_modules/_global/loading_card";
|
import ComponentGlobal_CardLoadingOverlay from "@/app_modules/_global/loading_card";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||||
|
|
||||||
export function ComponentDonasi_DetailDataMain({
|
export function ComponentDonasi_DetailDataMain({
|
||||||
donasi,
|
donasi,
|
||||||
@@ -47,13 +52,20 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack px={"xs"}>
|
<Stack
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Center>
|
<Center>
|
||||||
<Image
|
<Image
|
||||||
mah={500}
|
maw={200}
|
||||||
maw={"auto"}
|
radius={"xs"}
|
||||||
radius={"md"}
|
|
||||||
alt="Foto"
|
alt="Foto"
|
||||||
src={RouterDonasi.api_gambar + `${donasi.imagesId}`}
|
src={RouterDonasi.api_gambar + `${donasi.imagesId}`}
|
||||||
/>
|
/>
|
||||||
@@ -86,7 +98,12 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
</Stack>
|
</Stack>
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text fz={12}>Kategori</Text>
|
<Text fz={12}>Kategori</Text>
|
||||||
<Title order={4} c="blue">
|
<Title
|
||||||
|
order={4}
|
||||||
|
style={{
|
||||||
|
color: MainColor.yellow,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{donasi.DonasiMaster_Ketegori.name}
|
{donasi.DonasiMaster_Ketegori.name}
|
||||||
</Title>
|
</Title>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -102,19 +119,25 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
router.push(RouterDonasi.donatur + `${donasi.id}`);
|
router.push(RouterDonasi.donatur + `${donasi.id}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack align="center" spacing={"xs"}>
|
<Stack
|
||||||
<Group>
|
align="center"
|
||||||
|
spacing={"xs"}
|
||||||
|
style={{
|
||||||
|
color: MainColor.yellow,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Group align="center" h={"100%"}>
|
||||||
{isLoadingDonatur ? (
|
{isLoadingDonatur ? (
|
||||||
<Loader size={25} />
|
<ComponentGlobal_Loader size={25} />
|
||||||
) : (
|
) : (
|
||||||
<IconClover color="skyblue" />
|
<IconClover />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Title order={6} c={"blue"}>
|
<Title order={6}>{countDonatur}</Title>
|
||||||
{countDonatur}
|
|
||||||
</Title>
|
|
||||||
</Group>
|
</Group>
|
||||||
<Text fz={"xs"}>Donatur</Text>
|
<Text fz={"xs"} c={"white"}>
|
||||||
|
Donatur
|
||||||
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Divider orientation="vertical" />
|
<Divider orientation="vertical" />
|
||||||
@@ -127,9 +150,13 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
>
|
>
|
||||||
<Stack spacing={"sm"} align="center">
|
<Stack spacing={"sm"} align="center">
|
||||||
{isLoadingKabar ? (
|
{isLoadingKabar ? (
|
||||||
<Loader size={25} />
|
<ComponentGlobal_Loader size={25} />
|
||||||
) : (
|
) : (
|
||||||
<IconMessageChatbot color="skyblue" />
|
<IconMessageChatbot
|
||||||
|
style={{
|
||||||
|
color: MainColor.yellow,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
<Text fz={"xs"}>Kabar Terbaru</Text>
|
<Text fz={"xs"}>Kabar Terbaru</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -144,9 +171,13 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
>
|
>
|
||||||
<Stack spacing={"sm"} align="center">
|
<Stack spacing={"sm"} align="center">
|
||||||
{isLoadingPencairan ? (
|
{isLoadingPencairan ? (
|
||||||
<Loader size={25} />
|
<ComponentGlobal_Loader size={25} />
|
||||||
) : (
|
) : (
|
||||||
<IconMoneybag color="skyblue" />
|
<IconMoneybag
|
||||||
|
style={{
|
||||||
|
color: MainColor.yellow,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
<Text fz={"xs"}>Pencairan Dana</Text>
|
<Text fz={"xs"}>Pencairan Dana</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ import _ from "lodash";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import ComponentDonasi_NotedBox from "../noted_box";
|
import ComponentDonasi_NotedBox from "../noted_box";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||||
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
|
|
||||||
export default function ComponentDonasi_InformasiPenggalangMain({
|
export default function ComponentDonasi_InformasiPenggalangMain({
|
||||||
author,
|
author,
|
||||||
@@ -27,21 +33,41 @@ export default function ComponentDonasi_InformasiPenggalangMain({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(author, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(author, null, 2)}</pre> */}
|
||||||
<Stack spacing={"xs"}>
|
<Stack
|
||||||
|
spacing={"xs"}
|
||||||
|
style={{
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Title order={4}>Informasi Penggalang Dana</Title>
|
<Title order={4}>Informasi Penggalang Dana</Title>
|
||||||
<Paper p={"sm"} withBorder>
|
<Paper
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Title order={5}>Penggalang Dana</Title>
|
<Title order={5}>Penggalang Dana</Title>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
loading={isLoading ? true : false}
|
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
router.push(RouterDonasi.penggalang_dana + `${author.id}`);
|
router.push(RouterDonasi.penggalang_dana + `${author.id}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconCircleChevronRight />
|
{isLoading ? (
|
||||||
|
<ComponentGlobal_Loader />
|
||||||
|
) : (
|
||||||
|
<IconCircleChevronRight
|
||||||
|
style={{
|
||||||
|
color: MainColor.yellow,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
@@ -56,7 +82,7 @@ export default function ComponentDonasi_InformasiPenggalangMain({
|
|||||||
</Avatar>
|
</Avatar>
|
||||||
<Text>{author.username}</Text>
|
<Text>{author.username}</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<ComponentDonasi_NotedBox
|
<ComponentGlobal_BoxInformation
|
||||||
informasi="Semua dana yang terkumpul akan disalurkan ke penggalang dana,
|
informasi="Semua dana yang terkumpul akan disalurkan ke penggalang dana,
|
||||||
kabar penyaluran dapat dilihat di halaman kabar terbaru."
|
kabar penyaluran dapat dilihat di halaman kabar terbaru."
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { useAtom } from "jotai";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { gs_proses_donasi } from "../global_state";
|
import { gs_proses_donasi } from "../global_state";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function ButtonDonasi({ donasiId }: { donasiId: string }) {
|
export default function ButtonDonasi({ donasiId }: { donasiId: string }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -24,7 +25,11 @@ export default function ButtonDonasi({ donasiId }: { donasiId: string }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Footer height={70} px={"md"} sx={{ borderStyle: "none" }}>
|
<Footer
|
||||||
|
height={70}
|
||||||
|
px={"md"}
|
||||||
|
sx={{ borderStyle: "none", backgroundColor: "transparent" }}
|
||||||
|
>
|
||||||
<Center h={70}>
|
<Center h={70}>
|
||||||
<Button
|
<Button
|
||||||
loaderPosition="center"
|
loaderPosition="center"
|
||||||
@@ -32,6 +37,9 @@ export default function ButtonDonasi({ donasiId }: { donasiId: string }) {
|
|||||||
w={"100%"}
|
w={"100%"}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => onClick()}
|
onClick={() => onClick()}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Donasi
|
Donasi
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,9 +1,21 @@
|
|||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import { Text } from "@mantine/core";
|
import { Text } from "@mantine/core";
|
||||||
|
|
||||||
export default function TampilanRupiahDonasi({nominal, fontSize}: {nominal: number, fontSize?: number}) {
|
export default function TampilanRupiahDonasi({
|
||||||
|
nominal,
|
||||||
|
fontSize,
|
||||||
|
}: {
|
||||||
|
nominal: number;
|
||||||
|
fontSize?: number;
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Text fz={ fontSize ? fontSize : "md"}>
|
<Text
|
||||||
|
fz={fontSize ? fontSize : "md"}
|
||||||
|
style={{
|
||||||
|
color: MainColor.yellow,
|
||||||
|
}}
|
||||||
|
>
|
||||||
Rp.{" "}
|
Rp.{" "}
|
||||||
{new Intl.NumberFormat("id-ID", { maximumFractionDigits: 10 }).format(
|
{new Intl.NumberFormat("id-ID", { maximumFractionDigits: 10 }).format(
|
||||||
nominal
|
nominal
|
||||||
|
|||||||
@@ -27,8 +27,13 @@ import toast from "react-simple-toasts";
|
|||||||
import ComponentDonasi_NotedBox from "../component/noted_box";
|
import ComponentDonasi_NotedBox from "../component/noted_box";
|
||||||
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
||||||
import { Donasi_funCreate } from "../fun/create/fun_create_donasi";
|
import { Donasi_funCreate } from "../fun/create/fun_create_donasi";
|
||||||
import { gs_donasi_tabs_posting } from "../global_state";
|
import { gs_donasi_hot_menu, gs_donasi_tabs_posting } from "../global_state";
|
||||||
import { MODEL_DONASI_TEMPORARY } from "../model/interface";
|
import { MODEL_DONASI_TEMPORARY } from "../model/interface";
|
||||||
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
export default function CreateCeritaPenggalangDonasi({
|
export default function CreateCeritaPenggalangDonasi({
|
||||||
dataTemporary,
|
dataTemporary,
|
||||||
userId,
|
userId,
|
||||||
@@ -42,6 +47,8 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
const [tabsPostingDonasi, setTabsPostingDonasi] = useAtom(
|
const [tabsPostingDonasi, setTabsPostingDonasi] = useAtom(
|
||||||
gs_donasi_tabs_posting
|
gs_donasi_tabs_posting
|
||||||
);
|
);
|
||||||
|
const [donasiHotMenu, setDonasiHotMenu] = useAtom(gs_donasi_hot_menu);
|
||||||
|
|
||||||
const [create, setCreate] = useState({
|
const [create, setCreate] = useState({
|
||||||
pembukaan: "",
|
pembukaan: "",
|
||||||
cerita: "",
|
cerita: "",
|
||||||
@@ -78,8 +85,9 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
await Donasi_funCreate(body as any, gambar).then((res) => {
|
await Donasi_funCreate(body as any, gambar).then((res) => {
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
router.push(RouterDonasi.page_pop_up_create);
|
router.push(RouterDonasi.page_pop_up_create, { scroll: false });
|
||||||
setTabsPostingDonasi("Review");
|
setTabsPostingDonasi("Review");
|
||||||
|
setDonasiHotMenu(1);
|
||||||
} else {
|
} else {
|
||||||
toast(res.message);
|
toast(res.message);
|
||||||
}
|
}
|
||||||
@@ -87,19 +95,24 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={50} px={"md"}>
|
<Stack spacing={50} px={"md"} py={"md"}>
|
||||||
{/* <pre>{JSON.stringify(dataTempo, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(dataTempo, null, 2)}</pre> */}
|
||||||
<Stack spacing={"sm"}>
|
<Stack spacing={"sm"}>
|
||||||
<ComponentDonasi_NotedBox informasi="Ceritakan dengan jujur & benar mengapa Penggalanagn Dana ini harus diadakan!" />
|
<ComponentGlobal_BoxInformation informasi="Ceritakan dengan jujur & benar mengapa Penggalanagn Dana ini harus diadakan!" />
|
||||||
|
|
||||||
<Stack spacing={5}>
|
<Stack spacing={5}>
|
||||||
<Textarea
|
<Textarea
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
autosize
|
autosize
|
||||||
minRows={2}
|
minRows={2}
|
||||||
maxRows={4}
|
maxRows={4}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Pembukaan"
|
label="Pembukaan"
|
||||||
placeholder="Pembuka dari isi cerita"
|
placeholder="Pembuka cerita"
|
||||||
maxLength={300}
|
maxLength={300}
|
||||||
onChange={(val) =>
|
onChange={(val) =>
|
||||||
setCreate({
|
setCreate({
|
||||||
@@ -116,6 +129,11 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
|
|
||||||
<Stack spacing={5}>
|
<Stack spacing={5}>
|
||||||
<Textarea
|
<Textarea
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
autosize
|
autosize
|
||||||
minRows={2}
|
minRows={2}
|
||||||
maxRows={10}
|
maxRows={10}
|
||||||
@@ -158,12 +176,12 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Button
|
<Button
|
||||||
compact
|
|
||||||
{...props}
|
{...props}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
variant="outline"
|
|
||||||
w={150}
|
|
||||||
leftIcon={<IconCamera />}
|
leftIcon={<IconCamera />}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</Button>
|
</Button>
|
||||||
@@ -172,17 +190,25 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
{imageCerita ? (
|
{imageCerita ? (
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={1 / 1} mah={300}>
|
||||||
<Paper radius={"md"}>
|
<Paper
|
||||||
|
style={{
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
padding: "10px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Image
|
<Image
|
||||||
alt="Foto"
|
alt="Foto"
|
||||||
src={imageCerita ? imageCerita : "/aset/no-img.png"}
|
src={imageCerita ? imageCerita : "/aset/no-img.png"}
|
||||||
|
maw={200}
|
||||||
/>
|
/>
|
||||||
</Paper>
|
</Paper>
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
) : (
|
) : (
|
||||||
<Center>
|
<Center>
|
||||||
<Text fs={"italic"} fz={10}>
|
<Text fs={"italic"} fz={10} c={"white"}>
|
||||||
Upload poster atau gambar penggalangan !
|
Upload poster atau gambar penggalangan !
|
||||||
</Text>
|
</Text>
|
||||||
</Center>
|
</Center>
|
||||||
@@ -191,8 +217,13 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Stack spacing={"sm"}>
|
<Stack spacing={"sm"}>
|
||||||
<ComponentDonasi_NotedBox informasi="Lengkapi nama bank dan rekening di bawah untuk mempermudah admin jika penggalangan dana ini telah di publish!" />
|
<ComponentGlobal_BoxInformation informasi="Lengkapi nama bank dan rekening di bawah untuk mempermudah admin jika penggalangan dana ini telah di publish!" />
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
placeholder="Contoh: BNI, BCA, MANDIRI, DLL"
|
placeholder="Contoh: BNI, BCA, MANDIRI, DLL"
|
||||||
label="Nama Bank"
|
label="Nama Bank"
|
||||||
@@ -205,6 +236,11 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
placeholder="Maskuan nomor rekening"
|
placeholder="Maskuan nomor rekening"
|
||||||
label="Nomor rekening"
|
label="Nomor rekening"
|
||||||
@@ -229,6 +265,9 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
w={"100%"}
|
w={"100%"}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => onCreate()}
|
onClick={() => onCreate()}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -11,12 +11,17 @@ import {
|
|||||||
Select,
|
Select,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
TextInput
|
TextInput,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconCamera } from "@tabler/icons-react";
|
import { IconCamera } from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
import {
|
import {
|
||||||
ComponentGlobal_WarningMaxUpload,
|
ComponentGlobal_WarningMaxUpload,
|
||||||
maksimalUploadFile,
|
maksimalUploadFile,
|
||||||
@@ -24,11 +29,11 @@ import {
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
import ComponentDonasi_NotedBox from "../component/noted_box";
|
|
||||||
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
||||||
import Donasi_funCreateTemporary from "../fun/create/fun_create_donasi_temporary";
|
import Donasi_funCreateTemporary from "../fun/create/fun_create_donasi_temporary";
|
||||||
import { gs_donasi_tabs_posting } from "../global_state";
|
import { gs_donasi_tabs_posting } from "../global_state";
|
||||||
import { MODEL_DONASI_ALL_MASTER } from "../model/interface";
|
import { MODEL_DONASI_ALL_MASTER } from "../model/interface";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
|
||||||
export default function CreateDonasi({
|
export default function CreateDonasi({
|
||||||
masterKategori,
|
masterKategori,
|
||||||
@@ -75,16 +80,21 @@ export default function CreateDonasi({
|
|||||||
setTabsPostingDonasi("Review");
|
setTabsPostingDonasi("Review");
|
||||||
router.push(RouterDonasi.create_cerita_penggalang + `${res.donasiId}`);
|
router.push(RouterDonasi.create_cerita_penggalang + `${res.donasiId}`);
|
||||||
} else {
|
} else {
|
||||||
toast(res.message);
|
return ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"md"} px={"md"}>
|
<Stack spacing={"md"} px={"xs"}>
|
||||||
<ComponentDonasi_NotedBox informasi="Lengkapi semua data di bawah untuk selanjutnya mengisi cerita Penggalangan Dana!" />
|
<ComponentGlobal_BoxInformation informasi="Lengkapi semua data di bawah untuk selanjutnya mengisi cerita Penggalangan Dana!" />
|
||||||
<Select
|
<Select
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
label="Kategori"
|
label="Kategori"
|
||||||
placeholder="Pilih kategori penggalangan dana"
|
placeholder="Pilih kategori penggalangan dana"
|
||||||
withAsterisk
|
withAsterisk
|
||||||
@@ -102,6 +112,11 @@ export default function CreateDonasi({
|
|||||||
|
|
||||||
<Stack>
|
<Stack>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Judul Donasi"
|
label="Judul Donasi"
|
||||||
placeholder="Contoh: Renovasi Masjid pada kampung, dll"
|
placeholder="Contoh: Renovasi Masjid pada kampung, dll"
|
||||||
@@ -111,6 +126,11 @@ export default function CreateDonasi({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
icon={<Text fw={"bold"}>Rp.</Text>}
|
icon={<Text fw={"bold"}>Rp.</Text>}
|
||||||
min={0}
|
min={0}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
@@ -141,6 +161,11 @@ export default function CreateDonasi({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
label="Durasi"
|
label="Durasi"
|
||||||
placeholder="Jangka waktu penggalangan dana"
|
placeholder="Jangka waktu penggalangan dana"
|
||||||
withAsterisk
|
withAsterisk
|
||||||
@@ -175,12 +200,12 @@ export default function CreateDonasi({
|
|||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Button
|
<Button
|
||||||
compact
|
|
||||||
{...props}
|
{...props}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
variant="outline"
|
|
||||||
w={150}
|
|
||||||
leftIcon={<IconCamera />}
|
leftIcon={<IconCamera />}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</Button>
|
</Button>
|
||||||
@@ -188,17 +213,25 @@ export default function CreateDonasi({
|
|||||||
</FileButton>
|
</FileButton>
|
||||||
</Center>
|
</Center>
|
||||||
{imageDonasi ? (
|
{imageDonasi ? (
|
||||||
<AspectRatio ratio={1 / 1} onChange={(val) => console.log(val)}>
|
<AspectRatio ratio={1 / 1} mah={300}>
|
||||||
<Paper radius={"sm"} withBorder>
|
<Paper
|
||||||
|
style={{
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
padding: "10px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Image
|
<Image
|
||||||
alt="Foto"
|
alt="Foto"
|
||||||
src={imageDonasi ? imageDonasi : "/aset/no-img.png"}
|
src={imageDonasi ? imageDonasi : "/aset/no-img.png"}
|
||||||
|
maw={200}
|
||||||
/>
|
/>
|
||||||
</Paper>
|
</Paper>
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
) : (
|
) : (
|
||||||
<Center>
|
<Center>
|
||||||
<Text fs={"italic"} fz={10}>
|
<Text fs={"italic"} fz={10} c={"white"}>
|
||||||
Upload poster atau gambar penggalangan !
|
Upload poster atau gambar penggalangan !
|
||||||
</Text>
|
</Text>
|
||||||
</Center>
|
</Center>
|
||||||
@@ -216,6 +249,9 @@ export default function CreateDonasi({
|
|||||||
my={"lg"}
|
my={"lg"}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => onCreate()}
|
onClick={() => onCreate()}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Selanjutnya
|
Selanjutnya
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
"use client"
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate"
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import React from "react"
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import ComponentDonasi_HeaderTamplate from "../component/header_tamplate"
|
import React from "react";
|
||||||
|
|
||||||
export default function LayoutCreateDonasi({children}: {children: React.ReactNode}){
|
export default function LayoutCreateDonasi({
|
||||||
return<>
|
children,
|
||||||
<AppComponentGlobal_LayoutTamplate header={<ComponentDonasi_HeaderTamplate title="Buat Donasi"/>}>
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<UIGlobal_LayoutTamplate
|
||||||
|
header={<UIGlobal_LayoutHeaderTamplate title="Tambah Donasi" />}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
}
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,50 +1,39 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import {
|
import { Button, Stack } from "@mantine/core";
|
||||||
Stack,
|
|
||||||
AspectRatio,
|
|
||||||
Paper,
|
|
||||||
Title,
|
|
||||||
Progress,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Divider,
|
|
||||||
ActionIcon,
|
|
||||||
Avatar,
|
|
||||||
Text,
|
|
||||||
Image,
|
|
||||||
Button,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import {
|
|
||||||
IconClover,
|
|
||||||
IconMail,
|
|
||||||
IconMoneybag,
|
|
||||||
IconCircleChevronRight,
|
|
||||||
IconMessageChatbot,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import ComponentDonasi_NotedBox from "../../component/noted_box";
|
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
|
||||||
|
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
||||||
|
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
||||||
|
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
||||||
|
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
||||||
import { gs_donasi_tabs_posting } from "../../global_state";
|
import { gs_donasi_tabs_posting } from "../../global_state";
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
|
|
||||||
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
|
||||||
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
|
||||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
|
||||||
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
|
import { Donasi_getOneById } from "../../fun/get/get_one_donasi_by_id";
|
||||||
|
|
||||||
export default function DetailDraftDonasi({
|
export default function DetailDraftDonasi({
|
||||||
dataDonasi,
|
dataDonasi,
|
||||||
}: {
|
}: {
|
||||||
dataDonasi: MODEL_DONASI;
|
dataDonasi: MODEL_DONASI;
|
||||||
}) {
|
}) {
|
||||||
|
// const [data, setData] = useState(dataDonasi);
|
||||||
|
|
||||||
|
// useShallowEffect(() => {
|
||||||
|
// loadData({ id: dataDonasi.id });
|
||||||
|
// }, [dataDonasi.id]);
|
||||||
|
|
||||||
|
// async function loadData({ id }: { id: string }) {
|
||||||
|
// const loadData = await Donasi_getOneById(id);
|
||||||
|
// setData(loadData as any);
|
||||||
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xl"}>
|
<Stack spacing={"xl"} py={"md"}>
|
||||||
<ComponentDonasi_DetailDataGalangDana donasi={dataDonasi} />
|
<ComponentDonasi_DetailDataGalangDana donasi={dataDonasi} />
|
||||||
<ComponentDonasi_CeritaPenggalangMain donasi={dataDonasi} />
|
<ComponentDonasi_CeritaPenggalangMain donasi={dataDonasi} />
|
||||||
<ButtonAjukanPenggalangan dataDonasi={dataDonasi} />
|
<ButtonAjukanPenggalangan dataDonasi={dataDonasi} />
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
|
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Button,
|
Button,
|
||||||
@@ -9,12 +12,16 @@ import {
|
|||||||
Header,
|
Header,
|
||||||
Modal,
|
Modal,
|
||||||
Stack,
|
Stack,
|
||||||
Title
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
|
import { IconTornado } from "@tabler/icons-react";
|
||||||
import {
|
import {
|
||||||
IconChevronLeft,
|
IconChevronLeft,
|
||||||
IconEdit
|
IconCreditCard,
|
||||||
|
IconDotsVertical,
|
||||||
|
IconEdit,
|
||||||
|
IconEditCircle,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
@@ -26,85 +33,134 @@ export default function LayoutDetailDraftDonasi({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
donasiId: string;
|
donasiId: string;
|
||||||
}) {
|
}) {
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [isLoadingDonasi, setLoadingDonasi] = useState(false);
|
const [isLoadingDonasi, setLoadingDonasi] = useState(false);
|
||||||
const [isLoadingCerita, setLoadingCerita] = useState(false);
|
const [isLoadingCerita, setLoadingCerita] = useState(false);
|
||||||
const [isLoadingRekening, setLoadingRekening] = useState(false);
|
const [isLoadingRekening, setLoadingRekening] = useState(false);
|
||||||
|
|
||||||
|
const listPage = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
name: "Edit Donasi",
|
||||||
|
icon: <IconEdit />,
|
||||||
|
path: RouterDonasi.edit_donasi + donasiId,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
name: "Edit Cerita Pengalang",
|
||||||
|
icon: <IconTornado />,
|
||||||
|
path: RouterDonasi.edit_cerita_penggalang + donasiId,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
name: "Edit Rekening",
|
||||||
|
icon: <IconCreditCard />,
|
||||||
|
path: RouterDonasi.edit_rekening + donasiId,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={
|
header={
|
||||||
<Header height={50} sx={{ borderStyle: "none" }}>
|
<UIGlobal_LayoutHeaderTamplate
|
||||||
<Group h={50} position="apart" px={"md"}>
|
title="Detail Draft"
|
||||||
|
customButtonRight={
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
onClick={() => {
|
onClick={() => setOpenDrawer(true)}
|
||||||
router.back();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<IconChevronLeft />
|
<IconDotsVertical color="white" />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
<Title order={5}>Detail Draft</Title>
|
}
|
||||||
<ActionIcon variant="transparent" onClick={() => open()}>
|
/>
|
||||||
<IconEdit />
|
|
||||||
</ActionIcon>
|
|
||||||
</Group>
|
|
||||||
</Header>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
<Modal opened={opened} onClose={close} centered withCloseButton={false}>
|
|
||||||
<Stack>
|
<UIGlobal_Drawer
|
||||||
<Button
|
opened={openDrawer}
|
||||||
loaderPosition="center"
|
close={() => setOpenDrawer(false)}
|
||||||
loading={isLoadingDonasi ? true : false}
|
component={listPage}
|
||||||
style={{ transition: "0.5s" }}
|
/>
|
||||||
variant="outline"
|
|
||||||
radius={"xl"}
|
|
||||||
w={"100%"}
|
|
||||||
color="blue"
|
|
||||||
onClick={() => {
|
|
||||||
setLoadingDonasi(true);
|
|
||||||
router.push(RouterDonasi.edit_donasi + `${donasiId}`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Edit Donasi
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
loaderPosition="center"
|
|
||||||
loading={isLoadingCerita ? true : false}
|
|
||||||
style={{ transition: "0.5s" }}
|
|
||||||
variant="outline"
|
|
||||||
radius={"xl"}
|
|
||||||
w={"100%"}
|
|
||||||
color="teal"
|
|
||||||
onClick={() => {
|
|
||||||
setLoadingCerita(true);
|
|
||||||
router.push(RouterDonasi.edit_cerita_penggalang + `${donasiId}`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Edit Cerita
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
loaderPosition="center"
|
|
||||||
loading={isLoadingRekening ? true : false}
|
|
||||||
style={{ transition: "0.5s" }}
|
|
||||||
variant="outline"
|
|
||||||
radius={"xl"}
|
|
||||||
w={"100%"}
|
|
||||||
color="orange"
|
|
||||||
onClick={() => {
|
|
||||||
setLoadingRekening(true);
|
|
||||||
router.push(RouterDonasi.edit_rekening + `${donasiId}`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Edit Rekening
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
|
||||||
</Modal>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// return (
|
||||||
|
// <>
|
||||||
|
// <AppComponentGlobal_LayoutTamplate
|
||||||
|
// header={
|
||||||
|
// <Header height={50} sx={{ borderStyle: "none" }}>
|
||||||
|
// <Group h={50} position="apart" px={"md"}>
|
||||||
|
// <ActionIcon
|
||||||
|
// variant="transparent"
|
||||||
|
// onClick={() => {
|
||||||
|
// router.back();
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// <IconChevronLeft />
|
||||||
|
// </ActionIcon>
|
||||||
|
// <Title order={5}>Detail Draft</Title>
|
||||||
|
// <ActionIcon variant="transparent" onClick={() => open()}>
|
||||||
|
// <IconEdit />
|
||||||
|
// </ActionIcon>
|
||||||
|
// </Group>
|
||||||
|
// </Header>
|
||||||
|
// }
|
||||||
|
// >
|
||||||
|
// {children}
|
||||||
|
// </AppComponentGlobal_LayoutTamplate>
|
||||||
|
// <Modal opened={opened} onClose={close} centered withCloseButton={false}>
|
||||||
|
// <Stack>
|
||||||
|
// <Button
|
||||||
|
// loaderPosition="center"
|
||||||
|
// loading={isLoadingDonasi ? true : false}
|
||||||
|
// style={{ transition: "0.5s" }}
|
||||||
|
// variant="outline"
|
||||||
|
// radius={"xl"}
|
||||||
|
// w={"100%"}
|
||||||
|
// color="blue"
|
||||||
|
// onClick={() => {
|
||||||
|
// setLoadingDonasi(true);
|
||||||
|
// router.push(RouterDonasi.edit_donasi + `${donasiId}`);
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// Edit Donasi
|
||||||
|
// </Button>
|
||||||
|
// <Button
|
||||||
|
// loaderPosition="center"
|
||||||
|
// loading={isLoadingCerita ? true : false}
|
||||||
|
// style={{ transition: "0.5s" }}
|
||||||
|
// variant="outline"
|
||||||
|
// radius={"xl"}
|
||||||
|
// w={"100%"}
|
||||||
|
// color="teal"
|
||||||
|
// onClick={() => {
|
||||||
|
// setLoadingCerita(true);
|
||||||
|
// router.push(RouterDonasi.edit_cerita_penggalang + `${donasiId}`);
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// Edit Cerita
|
||||||
|
// </Button>
|
||||||
|
// <Button
|
||||||
|
// loaderPosition="center"
|
||||||
|
// loading={isLoadingRekening ? true : false}
|
||||||
|
// style={{ transition: "0.5s" }}
|
||||||
|
// variant="outline"
|
||||||
|
// radius={"xl"}
|
||||||
|
// w={"100%"}
|
||||||
|
// color="orange"
|
||||||
|
// onClick={() => {
|
||||||
|
// setLoadingRekening(true);
|
||||||
|
// router.push(RouterDonasi.edit_rekening + `${donasiId}`);
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// Edit Rekening
|
||||||
|
// </Button>
|
||||||
|
// </Stack>
|
||||||
|
// </Modal>
|
||||||
|
// </>
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import { MODEL_CERITA_DONASI } from "@/app_modules/donasi/model/interface";
|
import { MODEL_CERITA_DONASI } from "@/app_modules/donasi/model/interface";
|
||||||
import { Box, Image, Stack, Text } from "@mantine/core";
|
import { Box, Image, Stack, Text } from "@mantine/core";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
@@ -15,7 +16,16 @@ export default function CeritaPenggalangDonasi({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(data.imageCeritaDonasi, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(data.imageCeritaDonasi, null, 2)}</pre> */}
|
||||||
<Stack px={"xs"}>
|
<Stack
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
borderRadius: "10px",
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Text>
|
<Text>
|
||||||
{new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
|
{new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
|
||||||
data.createdAt
|
data.createdAt
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import ButtonDonasi from "@/app_modules/donasi/component/footer_button_donasi";
|
import ButtonDonasi from "@/app_modules/donasi/component/footer_button_donasi";
|
||||||
import ComponentDonasi_HeaderTamplate from "@/app_modules/donasi/component/header_tamplate";
|
import ComponentDonasi_HeaderTamplate from "@/app_modules/donasi/component/header_tamplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
@@ -17,11 +19,11 @@ export default function LayoutCeritaPenggalangDonasi({
|
|||||||
if (statusDonasiId !== "1") {
|
if (statusDonasiId !== "1") {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Cerita Penggalang Dana" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Cerita Penggalang Dana" />}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,12 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
Stack
|
||||||
AspectRatio,
|
|
||||||
Avatar,
|
|
||||||
Badge,
|
|
||||||
Button,
|
|
||||||
Center,
|
|
||||||
Divider,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Image,
|
|
||||||
Paper,
|
|
||||||
Progress,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
|
||||||
IconCircleChevronRight,
|
|
||||||
IconClover,
|
|
||||||
IconMail,
|
|
||||||
IconMailAi,
|
|
||||||
IconMessageChatbot,
|
|
||||||
IconMoneybag,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import ComponentDonasi_NotedBox from "../../component/noted_box";
|
|
||||||
import { ComponentDonasi_DetailDataMain } from "../../component/detail_main/detail_data_donasi";
|
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
|
||||||
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
||||||
|
import { ComponentDonasi_DetailDataMain } from "../../component/detail_main/detail_data_donasi";
|
||||||
import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main/informasi_penggalang";
|
import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main/informasi_penggalang";
|
||||||
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
|
|
||||||
export default function DetailMainDonasi({
|
export default function DetailMainDonasi({
|
||||||
dataDonasi,
|
dataDonasi,
|
||||||
@@ -44,7 +19,7 @@ export default function DetailMainDonasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={40}>
|
<Stack spacing={40} py={"md"}>
|
||||||
<ComponentDonasi_DetailDataMain
|
<ComponentDonasi_DetailDataMain
|
||||||
donasi={dataDonasi}
|
donasi={dataDonasi}
|
||||||
countDonatur={countDonatur}
|
countDonatur={countDonatur}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import { Footer, Stack } from "@mantine/core";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ButtonDonasi from "../../component/footer_button_donasi";
|
import ButtonDonasi from "../../component/footer_button_donasi";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
|
||||||
|
|
||||||
export default function LayoutDetailMainDonasi({
|
export default function LayoutDetailMainDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -15,18 +14,12 @@ export default function LayoutDetailMainDonasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Detail Donasi" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Detail Donasi" />}
|
||||||
footer={
|
footer={<ButtonDonasi donasiId={donasiId} />}
|
||||||
<Footer height={"10vh"}>
|
|
||||||
<Stack justify="center" h={"100%"}>
|
|
||||||
<ButtonDonasi donasiId={donasiId} />
|
|
||||||
</Stack>
|
|
||||||
</Footer>
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
import ComponentDonasi_BoxPublish from "@/app_modules/donasi/component/box_publish";
|
import ComponentDonasi_CardPublish from "@/app_modules/donasi/component/card_view/box_publish";
|
||||||
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
||||||
import {
|
import {
|
||||||
MODEL_DONASI,
|
MODEL_DONASI,
|
||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||||
import {
|
import {
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Avatar,
|
|
||||||
Box,
|
Box,
|
||||||
Center,
|
Center,
|
||||||
Divider,
|
Divider,
|
||||||
@@ -23,18 +22,15 @@ import {
|
|||||||
SimpleGrid,
|
SimpleGrid,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
Title,
|
Title
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useViewportSize } from "@mantine/hooks";
|
import { useViewportSize } from "@mantine/hooks";
|
||||||
import {
|
import {
|
||||||
IconBrandGmail,
|
IconBrandGmail,
|
||||||
IconHome,
|
|
||||||
IconMoodSmile,
|
IconMoodSmile,
|
||||||
IconPhone,
|
IconPhone
|
||||||
IconRecordMail,
|
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import router from "next/router";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function PenggalangDanaDonasi({
|
export default function PenggalangDanaDonasi({
|
||||||
@@ -46,12 +42,16 @@ export default function PenggalangDanaDonasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack >
|
<Stack>
|
||||||
<InformasiPenggalang value={value as any} />
|
<InformasiPenggalang value={value as any} />
|
||||||
<ComponentDonasi_BoxPublish
|
{value.Donasi.map((e, i) => (
|
||||||
dataDonasi={value.Donasi}
|
<Box key={i}>
|
||||||
path={RouterDonasi.detail_publish}
|
<ComponentDonasi_CardPublish
|
||||||
/>
|
data={e}
|
||||||
|
path={RouterDonasi.detail_publish}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import ComponentDonasi_HeaderTamplate from "@/app_modules/donasi/component/header_tamplate";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import { AppShell } from "@mantine/core";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function LayoutPenggalangDanaDonasi({
|
export default function LayoutPenggalangDanaDonasi({
|
||||||
@@ -12,12 +11,14 @@ export default function LayoutPenggalangDanaDonasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Informasi Penggalangan Dana" />}
|
header={
|
||||||
|
<UIGlobal_LayoutHeaderTamplate title="Informasi Penggalangan Dana" />
|
||||||
|
}
|
||||||
// footer={<FooterDonasi />}
|
// footer={<FooterDonasi />}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
|
||||||
import {
|
import {
|
||||||
Stack,
|
Stack
|
||||||
AspectRatio,
|
|
||||||
Paper,
|
|
||||||
Title,
|
|
||||||
Progress,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Divider,
|
|
||||||
ActionIcon,
|
|
||||||
Avatar,
|
|
||||||
Text,
|
|
||||||
Image,
|
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
|
||||||
IconClover,
|
|
||||||
IconMail,
|
|
||||||
IconMoneybag,
|
|
||||||
IconCircleChevronRight,
|
|
||||||
IconMessageChatbot,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
||||||
import { ComponentDonasi_DetailDataMain } from "../../component/detail_main/detail_data_donasi";
|
import { ComponentDonasi_DetailDataMain } from "../../component/detail_main/detail_data_donasi";
|
||||||
import _ from "lodash";
|
|
||||||
import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main/informasi_penggalang";
|
import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main/informasi_penggalang";
|
||||||
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
|
|
||||||
export default function DetailPublishDonasi({
|
export default function DetailPublishDonasi({
|
||||||
dataPublish,
|
dataPublish,
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { AppShell } from "@mantine/core";
|
import { ActionIcon, AppShell } from "@mantine/core";
|
||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||||
import { IconEdit, IconMessageShare } from "@tabler/icons-react";
|
import {
|
||||||
|
IconDotsVertical,
|
||||||
|
IconEdit,
|
||||||
|
IconMessageShare,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
|
||||||
|
|
||||||
export default function LayoutDetailPublishDonasi({
|
export default function LayoutDetailPublishDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -14,19 +21,44 @@ export default function LayoutDetailPublishDonasi({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
donasiId: string;
|
donasiId: string;
|
||||||
}) {
|
}) {
|
||||||
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
|
|
||||||
|
const listPage = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
name: "Kabar",
|
||||||
|
icon: <IconMessageShare />,
|
||||||
|
path: RouterDonasi.list_kabar + donasiId,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={
|
header={
|
||||||
<ComponentDonasi_HeaderTamplate
|
<UIGlobal_LayoutHeaderTamplate
|
||||||
title="Detail Publish"
|
title="Detail Publish"
|
||||||
icon={<IconMessageShare />}
|
// icon={<IconMessageShare />}
|
||||||
route2={RouterDonasi.list_kabar + `${donasiId}`}
|
// route2={RouterDonasi.list_kabar + `${donasiId}`}
|
||||||
|
customButtonRight={
|
||||||
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
onClick={() => setOpenDrawer(true)}
|
||||||
|
>
|
||||||
|
<IconDotsVertical color="white" />
|
||||||
|
</ActionIcon>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
|
|
||||||
|
<UIGlobal_Drawer
|
||||||
|
opened={openDrawer}
|
||||||
|
close={() => setOpenDrawer(false)}
|
||||||
|
component={listPage}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,42 +2,28 @@
|
|||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import {
|
import {
|
||||||
Stack,
|
|
||||||
AspectRatio,
|
|
||||||
Paper,
|
|
||||||
Title,
|
|
||||||
Progress,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Divider,
|
|
||||||
ActionIcon,
|
|
||||||
Avatar,
|
|
||||||
Text,
|
|
||||||
Image,
|
|
||||||
Button,
|
Button,
|
||||||
Spoiler,
|
Group,
|
||||||
Modal,
|
Modal,
|
||||||
|
Paper,
|
||||||
|
Spoiler,
|
||||||
|
Stack,
|
||||||
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
|
||||||
IconClover,
|
|
||||||
IconMail,
|
|
||||||
IconMoneybag,
|
|
||||||
IconCircleChevronRight,
|
|
||||||
IconMessageChatbot,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import ComponentDonasi_NotedBox from "../../component/noted_box";
|
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { gs_donasi_tabs_posting } from "../../global_state";
|
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
|
import { useAtom } from "jotai";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
|
||||||
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
||||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
||||||
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
||||||
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
|
||||||
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
|
|
||||||
import { Donasi_funDeleteDonasiById } from "../../fun/delete/fin_delete_donasi_by_id";
|
import { Donasi_funDeleteDonasiById } from "../../fun/delete/fin_delete_donasi_by_id";
|
||||||
|
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
||||||
|
import { gs_donasi_tabs_posting } from "../../global_state";
|
||||||
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
|
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
||||||
|
|
||||||
export default function DetailRejectDonasi({
|
export default function DetailRejectDonasi({
|
||||||
dataReject,
|
dataReject,
|
||||||
@@ -47,8 +33,8 @@ export default function DetailRejectDonasi({
|
|||||||
const [donasi, setDonasi] = useState(dataReject);
|
const [donasi, setDonasi] = useState(dataReject);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xl"}>
|
<Stack spacing={"xl"} py={"md"}>
|
||||||
<AlasanPenolakan catatan={donasi.catatan} />
|
<ComponentGlobal_BoxInformation isReport informasi={donasi.catatan} />
|
||||||
<ComponentDonasi_DetailDataGalangDana donasi={donasi} />
|
<ComponentDonasi_DetailDataGalangDana donasi={donasi} />
|
||||||
<ComponentDonasi_CeritaPenggalangMain donasi={donasi} />
|
<ComponentDonasi_CeritaPenggalangMain donasi={donasi} />
|
||||||
<ButtonAction donasiId={donasi.id} />
|
<ButtonAction donasiId={donasi.id} />
|
||||||
@@ -79,7 +65,8 @@ function ButtonAction({ donasiId }: { donasiId: string }) {
|
|||||||
gs_donasi_tabs_posting
|
gs_donasi_tabs_posting
|
||||||
);
|
);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
// const [opened, { open, close }] = useDisclosure(false);
|
||||||
|
const [openModal, setOpenModal] = useState(false);
|
||||||
|
|
||||||
async function onCLick() {
|
async function onCLick() {
|
||||||
await Donasi_funGantiStatus(donasiId, "3").then((res) => {
|
await Donasi_funGantiStatus(donasiId, "3").then((res) => {
|
||||||
@@ -105,13 +92,12 @@ function ButtonAction({ donasiId }: { donasiId: string }) {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Group position="center">
|
<Group grow>
|
||||||
<Button
|
<Button
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
bg={"orange"}
|
bg={"orange"}
|
||||||
color="orange"
|
color="orange"
|
||||||
onClick={() => onCLick()}
|
onClick={() => onCLick()}
|
||||||
compact
|
|
||||||
>
|
>
|
||||||
Edit Donasi
|
Edit Donasi
|
||||||
</Button>
|
</Button>
|
||||||
@@ -119,32 +105,27 @@ function ButtonAction({ donasiId }: { donasiId: string }) {
|
|||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
bg={"red"}
|
bg={"red"}
|
||||||
color="red"
|
color="red"
|
||||||
onClick={() => open()}
|
onClick={() => setOpenModal(true)}
|
||||||
compact
|
|
||||||
>
|
>
|
||||||
Hapus Donasi
|
Hapus Donasi
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
<Modal
|
|
||||||
opened={opened}
|
<UIGlobal_Modal
|
||||||
onClose={close}
|
title={"Anda yakin ingin menghapus donasi ini ?"}
|
||||||
centered
|
opened={openModal}
|
||||||
title="Yakin menghapus Penggalanagn Dana ini ?"
|
close={() => setOpenModal(false)}
|
||||||
>
|
buttonKiri={
|
||||||
<Group position="center">
|
<Button radius={"xl"} onClick={() => setOpenModal(false)}>
|
||||||
<Button radius={"xl"} variant="outline" onClick={close}>
|
|
||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
}
|
||||||
radius={"xl"}
|
buttonKanan={
|
||||||
variant="outline"
|
<Button radius={"xl"} color="red" onClick={() => onDelete()}>
|
||||||
color="red"
|
|
||||||
onClick={() => onDelete()}
|
|
||||||
>
|
|
||||||
Hapus
|
Hapus
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
}
|
||||||
</Modal>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,21 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { AppShell } from "@mantine/core";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
|
||||||
import { IconEdit, IconMessageShare } from "@tabler/icons-react";
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
|
||||||
|
|
||||||
export default function LayoutDetailRejectDonasi({
|
export default function LayoutDetailRejectDonasi({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate header={<ComponentDonasi_HeaderTamplate title="Detail Reject" />}>
|
<UIGlobal_LayoutTamplate
|
||||||
|
header={<UIGlobal_LayoutHeaderTamplate title="Detail Reject" />}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,39 +2,20 @@
|
|||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import {
|
import {
|
||||||
Stack,
|
|
||||||
AspectRatio,
|
|
||||||
Paper,
|
|
||||||
Title,
|
|
||||||
Progress,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Divider,
|
|
||||||
ActionIcon,
|
|
||||||
Avatar,
|
|
||||||
Text,
|
|
||||||
Image,
|
|
||||||
Button,
|
Button,
|
||||||
|
Stack
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
|
||||||
IconClover,
|
|
||||||
IconMail,
|
|
||||||
IconMoneybag,
|
|
||||||
IconCircleChevronRight,
|
|
||||||
IconMessageChatbot,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import ComponentDonasi_NotedBox from "../../component/noted_box";
|
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
|
||||||
|
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
||||||
|
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
||||||
|
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
||||||
|
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
||||||
import { gs_donasi_tabs_posting } from "../../global_state";
|
import { gs_donasi_tabs_posting } from "../../global_state";
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
import { useState } from "react";
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
|
|
||||||
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
|
||||||
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
|
||||||
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
|
||||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
|
||||||
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
|
|
||||||
|
|
||||||
export default function DetailReviewDonasi({
|
export default function DetailReviewDonasi({
|
||||||
dataDonasi,
|
dataDonasi,
|
||||||
@@ -45,7 +26,7 @@ export default function DetailReviewDonasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xl"}>
|
<Stack spacing={"xl"} py={"md"}>
|
||||||
<ComponentDonasi_DetailDataGalangDana donasi={donasi} />
|
<ComponentDonasi_DetailDataGalangDana donasi={donasi} />
|
||||||
<ComponentDonasi_CeritaPenggalangMain donasi={donasi} />
|
<ComponentDonasi_CeritaPenggalangMain donasi={donasi} />
|
||||||
<ButtonBatalReview donasi={donasi} />
|
<ButtonBatalReview donasi={donasi} />
|
||||||
@@ -81,8 +62,8 @@ function ButtonBatalReview({ donasi }: { donasi: MODEL_DONASI }) {
|
|||||||
loaderPosition="center"
|
loaderPosition="center"
|
||||||
loading={isLoading ? true : false}
|
loading={isLoading ? true : false}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
bg={"red"}
|
bg={"orange"}
|
||||||
color="red"
|
color="orange"
|
||||||
onClick={() => onCLick()}
|
onClick={() => onCLick()}
|
||||||
>
|
>
|
||||||
Batalkan Review
|
Batalkan Review
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { AppShell } from "@mantine/core";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
|
||||||
import { IconEdit, IconMessageShare } from "@tabler/icons-react";
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
|
||||||
|
|
||||||
export default function LayoutDetailReviewDonasi({
|
export default function LayoutDetailReviewDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -15,9 +12,9 @@ export default function LayoutDetailReviewDonasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate header={<ComponentDonasi_HeaderTamplate title="Detail Review" />}>
|
<UIGlobal_LayoutTamplate header={<UIGlobal_LayoutHeaderTamplate title="Detail Review" />}>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ import {
|
|||||||
maksimalUploadFile,
|
maksimalUploadFile,
|
||||||
} from "@/app_modules/_global/component/waring_popup";
|
} from "@/app_modules/_global/component/waring_popup";
|
||||||
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
||||||
|
|
||||||
export default function EditCeritaPenggalangDonasi({
|
export default function EditCeritaPenggalangDonasi({
|
||||||
dataCerita,
|
dataCerita,
|
||||||
@@ -46,29 +51,49 @@ export default function EditCeritaPenggalangDonasi({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(value, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(value, null, 2)}</pre> */}
|
||||||
<Stack spacing={"md"} px={"md"}>
|
<Stack
|
||||||
<Textarea
|
spacing={"md"}
|
||||||
autosize
|
style={{
|
||||||
minRows={2}
|
padding: "15px",
|
||||||
maxRows={7}
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
withAsterisk
|
backgroundColor: AccentColor.darkblue,
|
||||||
label="Pembukaan"
|
borderRadius: "10px",
|
||||||
placeholder="Pembuka dari isi cerita"
|
color: "white",
|
||||||
value={value.pembukaan}
|
}}
|
||||||
error={
|
>
|
||||||
value.pembukaan === "" ? (
|
<Stack spacing={5}>
|
||||||
<ComponentGlobal_ErrorInput text="Masukan pembukaan cerita" />
|
<Textarea
|
||||||
) : (
|
styles={{
|
||||||
""
|
label: {
|
||||||
)
|
color: "white",
|
||||||
}
|
},
|
||||||
onChange={(val) =>
|
}}
|
||||||
setValue({
|
autosize
|
||||||
...value,
|
minRows={2}
|
||||||
pembukaan: val.target.value,
|
maxRows={7}
|
||||||
})
|
withAsterisk
|
||||||
}
|
label="Pembukaan"
|
||||||
/>
|
placeholder="Pembuka dari isi cerita"
|
||||||
|
value={value.pembukaan}
|
||||||
|
error={
|
||||||
|
value.pembukaan === "" ? (
|
||||||
|
<ComponentGlobal_ErrorInput text="Masukan pembukaan cerita" />
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onChange={(val) =>
|
||||||
|
setValue({
|
||||||
|
...value,
|
||||||
|
pembukaan: val.target.value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<ComponentGlobal_InputCountDown
|
||||||
|
lengthInput={value.pembukaan.length}
|
||||||
|
maxInput={300}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
<Stack spacing={"lg"}>
|
<Stack spacing={"lg"}>
|
||||||
<Center>
|
<Center>
|
||||||
@@ -93,20 +118,27 @@ export default function EditCeritaPenggalangDonasi({
|
|||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Button
|
<Button
|
||||||
compact
|
|
||||||
{...props}
|
{...props}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
variant="outline"
|
|
||||||
w={150}
|
|
||||||
leftIcon={<IconCamera />}
|
leftIcon={<IconCamera />}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</FileButton>
|
</FileButton>
|
||||||
</Center>
|
</Center>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={1 / 1} mah={300}>
|
||||||
<Paper radius={"md"}>
|
<Paper
|
||||||
|
style={{
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
padding: "10px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Image
|
<Image
|
||||||
alt="Foto"
|
alt="Foto"
|
||||||
src={
|
src={
|
||||||
@@ -115,33 +147,45 @@ export default function EditCeritaPenggalangDonasi({
|
|||||||
: RouterDonasi.api_image_cerita +
|
: RouterDonasi.api_image_cerita +
|
||||||
value.imageCeritaDonasi.url
|
value.imageCeritaDonasi.url
|
||||||
}
|
}
|
||||||
|
maw={200}
|
||||||
/>
|
/>
|
||||||
</Paper>
|
</Paper>
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Textarea
|
<Stack spacing={5}>
|
||||||
autosize
|
<Textarea
|
||||||
minRows={2}
|
styles={{
|
||||||
maxRows={7}
|
label: {
|
||||||
withAsterisk
|
color: "white",
|
||||||
label="Cerita"
|
},
|
||||||
placeholder="Ceritakan alasan mengapa harus membuat Penggalangan Dana"
|
}}
|
||||||
value={value.cerita}
|
autosize
|
||||||
error={
|
minRows={2}
|
||||||
value.cerita === "" ? (
|
maxRows={7}
|
||||||
<ComponentGlobal_ErrorInput text="Masukan pembukaan cerita" />
|
withAsterisk
|
||||||
) : (
|
label="Cerita"
|
||||||
""
|
placeholder="Ceritakan alasan mengapa harus membuat Penggalangan Dana"
|
||||||
)
|
value={value.cerita}
|
||||||
}
|
error={
|
||||||
onChange={(val) =>
|
value.cerita === "" ? (
|
||||||
setValue({
|
<ComponentGlobal_ErrorInput text="Masukan pembukaan cerita" />
|
||||||
...value,
|
) : (
|
||||||
cerita: val.target.value,
|
""
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
/>
|
onChange={(val) =>
|
||||||
|
setValue({
|
||||||
|
...value,
|
||||||
|
cerita: val.target.value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<ComponentGlobal_InputCountDown
|
||||||
|
lengthInput={value.cerita.length}
|
||||||
|
maxInput={300}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
style={{
|
style={{
|
||||||
@@ -155,6 +199,9 @@ export default function EditCeritaPenggalangDonasi({
|
|||||||
w={"100%"}
|
w={"100%"}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => onUpdate(router, value, file as any)}
|
onClick={() => onUpdate(router, value, file as any)}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Update
|
Update
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import { AppShell } from "@mantine/core";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
|
||||||
export default function LayoutEditCeritaPenggalangDonasi({
|
export default function LayoutEditCeritaPenggalangDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -12,9 +14,9 @@ export default function LayoutEditCeritaPenggalangDonasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate header={<ComponentDonasi_HeaderTamplate title="Update Cerita Penggalang" />}>
|
<UIGlobal_LayoutTamplate header={<UIGlobal_LayoutHeaderTamplate title="Update Cerita Penggalang" />}>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,35 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import {
|
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
||||||
Stack,
|
|
||||||
Select,
|
|
||||||
AspectRatio,
|
|
||||||
Paper,
|
|
||||||
Center,
|
|
||||||
Button,
|
|
||||||
TextInput,
|
|
||||||
Image,
|
|
||||||
FileButton,
|
|
||||||
Modal,
|
|
||||||
Group,
|
|
||||||
Title,
|
|
||||||
Text,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { IconCamera } from "@tabler/icons-react";
|
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { gs_donasi_tabs_posting } from "../../global_state";
|
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
import { MODEL_DONASI, MODEL_DONASI_ALL_MASTER } from "../../model/interface";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { Donasi_funUpdateDonasi } from "../../fun/update/fun_update_donasi";
|
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
|
||||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
|
||||||
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { Donasi_getOneById } from "../../fun/get/get_one_donasi_by_id";
|
|
||||||
import {
|
import {
|
||||||
ComponentGlobal_WarningMaxUpload,
|
ComponentGlobal_WarningMaxUpload,
|
||||||
maksimalUploadFile,
|
maksimalUploadFile,
|
||||||
} from "@/app_modules/_global/component/waring_popup";
|
} from "@/app_modules/_global/component/waring_popup";
|
||||||
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
import {
|
||||||
|
AspectRatio,
|
||||||
|
Button,
|
||||||
|
Center,
|
||||||
|
FileButton,
|
||||||
|
Image,
|
||||||
|
Paper,
|
||||||
|
Select,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
|
import { IconCamera } from "@tabler/icons-react";
|
||||||
|
import { useAtom } from "jotai";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
||||||
|
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
||||||
|
import { Donasi_funUpdateDonasi } from "../../fun/update/fun_update_donasi";
|
||||||
|
import { gs_donasi_tabs_posting } from "../../global_state";
|
||||||
|
import { MODEL_DONASI, MODEL_DONASI_ALL_MASTER } from "../../model/interface";
|
||||||
|
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function EditDonasi({
|
export default function EditDonasi({
|
||||||
dataDonasi,
|
dataDonasi,
|
||||||
@@ -62,6 +58,11 @@ export default function EditDonasi({
|
|||||||
{/* <pre>{JSON.stringify(donasi, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(donasi, null, 2)}</pre> */}
|
||||||
<Stack spacing={"md"} px={"md"}>
|
<Stack spacing={"md"} px={"md"}>
|
||||||
<Select
|
<Select
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
label="Kategori"
|
label="Kategori"
|
||||||
placeholder="Pilih kategori penggalangan dana"
|
placeholder="Pilih kategori penggalangan dana"
|
||||||
value={value.DonasiMaster_Ketegori.id}
|
value={value.DonasiMaster_Ketegori.id}
|
||||||
@@ -80,8 +81,15 @@ export default function EditDonasi({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Stack>
|
<Stack>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={1 / 1} mah={300}>
|
||||||
<Paper radius={"md"}>
|
<Paper
|
||||||
|
style={{
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
padding: "10px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Image
|
<Image
|
||||||
alt="Foto"
|
alt="Foto"
|
||||||
src={
|
src={
|
||||||
@@ -89,6 +97,7 @@ export default function EditDonasi({
|
|||||||
? updateImage
|
? updateImage
|
||||||
: RouterDonasi.api_gambar + `${value.imagesId}`
|
: RouterDonasi.api_gambar + `${value.imagesId}`
|
||||||
}
|
}
|
||||||
|
maw={200}
|
||||||
/>
|
/>
|
||||||
</Paper>
|
</Paper>
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
@@ -114,12 +123,12 @@ export default function EditDonasi({
|
|||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Button
|
<Button
|
||||||
compact
|
|
||||||
{...props}
|
{...props}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
variant="outline"
|
|
||||||
leftIcon={<IconCamera />}
|
leftIcon={<IconCamera />}
|
||||||
w={150}
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</Button>
|
</Button>
|
||||||
@@ -129,6 +138,11 @@ export default function EditDonasi({
|
|||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Judul Donasi"
|
label="Judul Donasi"
|
||||||
placeholder="Contoh: Renovasi Masjid pada kampung, dll"
|
placeholder="Contoh: Renovasi Masjid pada kampung, dll"
|
||||||
@@ -149,6 +163,11 @@ export default function EditDonasi({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
icon={<Text fw={"bold"}>Rp.</Text>}
|
icon={<Text fw={"bold"}>Rp.</Text>}
|
||||||
min={0}
|
min={0}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
@@ -184,6 +203,11 @@ export default function EditDonasi({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
label="Durasi"
|
label="Durasi"
|
||||||
placeholder="Jangka waktu penggalangan dana"
|
placeholder="Jangka waktu penggalangan dana"
|
||||||
withAsterisk
|
withAsterisk
|
||||||
@@ -214,6 +238,9 @@ export default function EditDonasi({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
onUpdate(value, file as any, router);
|
onUpdate(value, file as any, router);
|
||||||
}}
|
}}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Update
|
Update
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { AppShell } from "@mantine/core";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
|
||||||
|
|
||||||
export default function LayoutEditDonasi({
|
export default function LayoutEditDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -12,9 +11,9 @@ export default function LayoutEditDonasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate header={<ComponentDonasi_HeaderTamplate title="Edit Donasi" />}>
|
<UIGlobal_LayoutTamplate header={<UIGlobal_LayoutHeaderTamplate title="Edit Donasi" />}>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { Donasi_funUpdateRekening } from "../../fun/update/fun_update_rekening";
|
|||||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
||||||
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
||||||
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function Donasi_EditRekening({
|
export default function Donasi_EditRekening({
|
||||||
dataDonasi,
|
dataDonasi,
|
||||||
@@ -25,6 +26,11 @@ export default function Donasi_EditRekening({
|
|||||||
<Stack spacing={"xl"}>
|
<Stack spacing={"xl"}>
|
||||||
<Stack spacing={"sm"}>
|
<Stack spacing={"sm"}>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Nama Bank"
|
label="Nama Bank"
|
||||||
placeholder="Masukan Nama Bank"
|
placeholder="Masukan Nama Bank"
|
||||||
@@ -44,6 +50,11 @@ export default function Donasi_EditRekening({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
type="number"
|
type="number"
|
||||||
label="Nomor Rekening"
|
label="Nomor Rekening"
|
||||||
@@ -75,6 +86,9 @@ export default function Donasi_EditRekening({
|
|||||||
}
|
}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => onUpdate(router, donasi, setLoading)}
|
onClick={() => onUpdate(router, donasi, setLoading)}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Update
|
Update
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import { AppShell } from "@mantine/core";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
|
||||||
export default function LayoutDonasi_EditRekening({
|
export default function LayoutDonasi_EditRekening({
|
||||||
children,
|
children,
|
||||||
@@ -12,11 +14,11 @@ export default function LayoutDonasi_EditRekening({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Edit Rekening" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Edit Rekening" />}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,18 +20,12 @@ export async function Donasi_funCreate(req: MODEL_DONASI, file: FormData) {
|
|||||||
imagesId: body.imagesId,
|
imagesId: body.imagesId,
|
||||||
authorId: body.authorId,
|
authorId: body.authorId,
|
||||||
namaBank: body.namaBank,
|
namaBank: body.namaBank,
|
||||||
rekening: body.rekening
|
rekening: body.rekening,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!dataDonasi) return { status: 400, message: "Gagal disimpan" };
|
if (!dataDonasi) return { status: 400, message: "Gagal disimpan" };
|
||||||
await Donasi_funDeleteTemporaryCreate(body.id).then((res) => {
|
await Donasi_funDeleteTemporaryCreate(body.id);
|
||||||
if (res.status === 200) {
|
|
||||||
console.log(res.message);
|
|
||||||
} else {
|
|
||||||
console.log(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const dataImage: any = file.get("file");
|
const dataImage: any = file.get("file");
|
||||||
const fileName = dataImage.name;
|
const fileName = dataImage.name;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import MainDonasi from "./main/beranda";
|
import MainDonasi from "./main/beranda";
|
||||||
import LayoutDonasi from "./main/layout";
|
import LayoutDonasi from "./main/layout";
|
||||||
import GalangDanaDonasi from "./main/galang_dana";
|
import GalangDanaDonasi from "./main/galang_dana/ui_galang_dana";
|
||||||
import DonasiSayaDonasi from "./main/donasi_saya";
|
import DonasiSayaDonasi from "./main/donasi_saya";
|
||||||
import CreateDonasi from "./create/create_donasi";
|
import CreateDonasi from "./create/create_donasi";
|
||||||
import LayoutCreateDonasi from "./create/layout";
|
import LayoutCreateDonasi from "./create/layout";
|
||||||
|
|||||||
@@ -1,73 +1,41 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import { Warna } from "@/app/lib/warna";
|
import { ActionIcon, Affix, Box, rem } from "@mantine/core";
|
||||||
import {
|
import { useWindowScroll } from "@mantine/hooks";
|
||||||
ActionIcon,
|
|
||||||
Affix,
|
|
||||||
AspectRatio,
|
|
||||||
Avatar,
|
|
||||||
Badge,
|
|
||||||
Box,
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
CardSection,
|
|
||||||
Center,
|
|
||||||
Divider,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Image,
|
|
||||||
Paper,
|
|
||||||
Progress,
|
|
||||||
SimpleGrid,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
rem,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useViewportSize, useWindowScroll } from "@mantine/hooks";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { MODEL_DONASI } from "../model/interface";
|
|
||||||
import { useState } from "react";
|
|
||||||
import ComponentDonasi_BoxPublish from "../component/box_publish";
|
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
|
||||||
import { IconPencilPlus } from "@tabler/icons-react";
|
import { IconPencilPlus } from "@tabler/icons-react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
import ComponentDonasi_CardPublish from "../component/card_view/box_publish";
|
||||||
|
import { MODEL_DONASI } from "../model/interface";
|
||||||
|
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
|
||||||
|
import _ from "lodash";
|
||||||
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
|
|
||||||
export default function MainDonasi({
|
export default function MainDonasi({
|
||||||
listDonasi,
|
listDonasi,
|
||||||
}: {
|
}: {
|
||||||
listDonasi: MODEL_DONASI[];
|
listDonasi: MODEL_DONASI[];
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const [data, setData] = useState(listDonasi);
|
||||||
const [isLoading, setLoading] = useState(false);
|
|
||||||
const [scroll, scrollTo] = useWindowScroll();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Affix position={{ bottom: rem(150), right: rem(30) }}>
|
<Box>
|
||||||
<ActionIcon
|
<ComponentGlobal_CreateButton path={RouterDonasi.create_donasi} />
|
||||||
loading={isLoading ? true : false}
|
{_.isEmpty(data) ? (
|
||||||
opacity={scroll.y > 0 ? 0.5 : ""}
|
<ComponentGlobal_IsEmptyData />
|
||||||
style={{
|
) : (
|
||||||
transition: "0.5s",
|
data.map((e, i) => (
|
||||||
}}
|
<Box key={i}>
|
||||||
size={"xl"}
|
<ComponentDonasi_CardPublish
|
||||||
radius={"xl"}
|
data={e as any}
|
||||||
variant="transparent"
|
path={RouterDonasi.detail_main}
|
||||||
bg={"orange"}
|
/>
|
||||||
onClick={() => {
|
</Box>
|
||||||
setLoading(true);
|
))
|
||||||
router.push(RouterDonasi.create_donasi);
|
)}
|
||||||
}}
|
</Box>
|
||||||
>
|
|
||||||
<IconPencilPlus color="white" />
|
|
||||||
</ActionIcon>
|
|
||||||
</Affix>
|
|
||||||
|
|
||||||
<ComponentDonasi_BoxPublish
|
|
||||||
dataDonasi={listDonasi}
|
|
||||||
path={RouterDonasi.detail_main}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,30 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import {
|
import {
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Avatar,
|
|
||||||
Badge,
|
Badge,
|
||||||
Box,
|
Box,
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Center,
|
|
||||||
Divider,
|
|
||||||
Grid,
|
Grid,
|
||||||
Group,
|
Group,
|
||||||
Image,
|
Image,
|
||||||
Paper,
|
Paper,
|
||||||
Progress,
|
Progress,
|
||||||
SimpleGrid,
|
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useViewportSize } from "@mantine/hooks";
|
import { useViewportSize } from "@mantine/hooks";
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { MODEL_DONASI_INVOICE } from "../model/interface";
|
|
||||||
import { useState } from "react";
|
|
||||||
import TampilanRupiahDonasi from "../component/tampilan_rupiah";
|
|
||||||
import ComponentDonasi_TampilanHitungMundur from "../component/tampilan_hitung_mundur";
|
|
||||||
import moment from "moment";
|
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import ComponentDonasi_IsEmptyData from "../component/is_empty_data";
|
import moment from "moment";
|
||||||
|
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
import toast from "react-simple-toasts";
|
||||||
|
import ComponentDonasi_TampilanHitungMundur from "../component/tampilan_hitung_mundur";
|
||||||
|
import TampilanRupiahDonasi from "../component/tampilan_rupiah";
|
||||||
|
import { MODEL_DONASI_INVOICE } from "../model/interface";
|
||||||
|
|
||||||
export default function DonasiSayaDonasi({
|
export default function DonasiSayaDonasi({
|
||||||
listInvoice,
|
listInvoice,
|
||||||
@@ -42,71 +36,70 @@ export default function DonasiSayaDonasi({
|
|||||||
const { height, width } = useViewportSize();
|
const { height, width } = useViewportSize();
|
||||||
|
|
||||||
if (_.isEmpty(listInvoice))
|
if (_.isEmpty(listInvoice))
|
||||||
return <ComponentDonasi_IsEmptyData text="Tidak ada data" />;
|
return <ComponentGlobal_IsEmptyData />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SimpleGrid
|
{invoice.map((e, i) => (
|
||||||
cols={4}
|
<Box
|
||||||
spacing="lg"
|
style={{
|
||||||
breakpoints={[
|
backgroundColor: AccentColor.blue,
|
||||||
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
padding: "15px",
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
cursor: "pointer",
|
||||||
]}
|
borderRadius: "10px",
|
||||||
>
|
color: "white",
|
||||||
{invoice.map((e, i) => (
|
marginBottom: "15px",
|
||||||
<Box
|
}}
|
||||||
key={i}
|
key={i}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
onClick(router, e.donasiMaster_StatusInvoiceId, e.id, e.Donasi.id)
|
onClick(router, e.donasiMaster_StatusInvoiceId, e.id, e.Donasi.id)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={5}>
|
<Grid.Col span={5}>
|
||||||
<Stack spacing={5}>
|
<Stack spacing={5}>
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text fz={"xs"} fw={"bold"} truncate>
|
<Text fz={"xs"} fw={"bold"} truncate>
|
||||||
{e.Donasi.title}
|
{e.Donasi.title}
|
||||||
</Text>
|
</Text>
|
||||||
<ComponentDonasi_TampilanHitungMundur
|
<ComponentDonasi_TampilanHitungMundur
|
||||||
durasi={e.Donasi.DonasiMaster_Durasi.name}
|
durasi={e.Donasi.DonasiMaster_Durasi.name}
|
||||||
publishTime={e.Donasi.publishTime}
|
publishTime={e.Donasi.publishTime}
|
||||||
textSize={10}
|
textSize={10}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
|
||||||
<Progress value={+e.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={+e.nominal} />
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Group>
|
|
||||||
<Badge size="xs" variant="dot">
|
|
||||||
<Text>{e.DonasiMaster_StatusInvoice.name}</Text>
|
|
||||||
</Badge>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
<Progress value={+e.Donasi.progres} color="orange" />
|
||||||
<Grid.Col span={7}>
|
<Group position="apart">
|
||||||
<AspectRatio ratio={16 / 9}>
|
<Stack spacing={0}>
|
||||||
<Paper radius={"md"}>
|
<Text fz={10}>Donasi Saya</Text>
|
||||||
<Image
|
<Text fz={10} fw={"bold"} c={"orange"} truncate>
|
||||||
alt="Foto"
|
<TampilanRupiahDonasi nominal={+e.nominal} />
|
||||||
src={RouterDonasi.api_gambar + `${e.Donasi.imagesId}`}
|
</Text>
|
||||||
radius={"md"}
|
</Stack>
|
||||||
/>
|
</Group>
|
||||||
</Paper>
|
<Badge size="xs" variant="filled" color="yellow">
|
||||||
</AspectRatio>
|
<Text>{e.DonasiMaster_StatusInvoice.name}</Text>
|
||||||
</Grid.Col>
|
</Badge>
|
||||||
</Grid>
|
</Stack>
|
||||||
{width > 575 ? "" : <Divider />}
|
</Grid.Col>
|
||||||
</Stack>
|
<Grid.Col span={7}>
|
||||||
</Box>
|
<AspectRatio ratio={16 / 9}>
|
||||||
))}
|
<Paper radius={"md"}>
|
||||||
</SimpleGrid>
|
<Image
|
||||||
|
alt="Foto"
|
||||||
|
src={RouterDonasi.api_gambar + `${e.Donasi.imagesId}`}
|
||||||
|
radius={"md"}
|
||||||
|
/>
|
||||||
|
</Paper>
|
||||||
|
</AspectRatio>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
{/* {width > 575 ? "" : <Divider />} */}
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,118 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import {
|
|
||||||
Affix,
|
|
||||||
Box,
|
|
||||||
Button,
|
|
||||||
Divider,
|
|
||||||
Stack,
|
|
||||||
Tabs,
|
|
||||||
TabsProps,
|
|
||||||
Text,
|
|
||||||
rem,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { IconCirclePlus } from "@tabler/icons-react";
|
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { gs_donasi_tabs_posting } from "../global_state";
|
|
||||||
import PostingPublishDonasi from "./galang_dana/publish";
|
|
||||||
import PostingReviewDonasi from "./galang_dana/review";
|
|
||||||
import PostingRejectDonasi from "./galang_dana/reject";
|
|
||||||
import { Warna } from "@/app/lib/warna";
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
|
||||||
import PostingDraftDonasi from "./galang_dana/draft";
|
|
||||||
|
|
||||||
export default function GalangDanaDonasi({
|
|
||||||
listPublish,
|
|
||||||
listReview,
|
|
||||||
listDraft,
|
|
||||||
listReject,
|
|
||||||
}: {
|
|
||||||
listPublish: any;
|
|
||||||
listReview: any;
|
|
||||||
listDraft: any;
|
|
||||||
listReject: any;
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
|
||||||
const [tabsPostingDonasi, setTabsPostingDonasi] = useAtom(
|
|
||||||
gs_donasi_tabs_posting
|
|
||||||
);
|
|
||||||
|
|
||||||
const listPosting = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
value: "Publish",
|
|
||||||
path: <PostingPublishDonasi listPublish={listPublish} />,
|
|
||||||
color: "green",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
value: "Review",
|
|
||||||
path: <PostingReviewDonasi listReview={listReview} />,
|
|
||||||
color: "yellow",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
value: "Draft",
|
|
||||||
path: <PostingDraftDonasi listDraft={listDraft} />,
|
|
||||||
color: "red",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
value: "Reject",
|
|
||||||
path: <PostingRejectDonasi listReject={listReject} />,
|
|
||||||
color: "red",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{/* <Affix position={{ bottom: rem(150), right: rem(20) }}>
|
|
||||||
<Button
|
|
||||||
radius={"xl"}
|
|
||||||
bg={"orange"}
|
|
||||||
color="orange"
|
|
||||||
leftIcon={<IconCirclePlus />}
|
|
||||||
onClick={() => router.push(RouterDonasi.create_donasi)}
|
|
||||||
>
|
|
||||||
Galang Dana
|
|
||||||
</Button>
|
|
||||||
</Affix> */}
|
|
||||||
<Stack>
|
|
||||||
<Tabs
|
|
||||||
color="orange"
|
|
||||||
variant="pills"
|
|
||||||
radius="xl"
|
|
||||||
defaultValue="Publish"
|
|
||||||
value={tabsPostingDonasi}
|
|
||||||
onTabChange={setTabsPostingDonasi}
|
|
||||||
>
|
|
||||||
<Stack>
|
|
||||||
<Tabs.List grow>
|
|
||||||
{listPosting.map((e, i) => (
|
|
||||||
<Tabs.Tab
|
|
||||||
key={e.id}
|
|
||||||
value={e.value}
|
|
||||||
bg={tabsPostingDonasi === e.value ? e.color : "gray.1"}
|
|
||||||
>
|
|
||||||
<Text
|
|
||||||
c={tabsPostingDonasi === e.value ? "white" : "gray"}
|
|
||||||
fw={tabsPostingDonasi === e.value ? 900 : "normal"}
|
|
||||||
>
|
|
||||||
{e.value}
|
|
||||||
</Text>
|
|
||||||
</Tabs.Tab>
|
|
||||||
))}
|
|
||||||
</Tabs.List>
|
|
||||||
{listPosting.map((e, i) => (
|
|
||||||
<Tabs.Panel key={e.id} value={e.value} pt="xs">
|
|
||||||
{e.path}
|
|
||||||
</Tabs.Panel>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
</Tabs>
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -2,89 +2,30 @@
|
|||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import {
|
import {
|
||||||
AspectRatio,
|
Box
|
||||||
Box,
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Center,
|
|
||||||
Divider,
|
|
||||||
Grid,
|
|
||||||
Image,
|
|
||||||
Paper,
|
|
||||||
Progress,
|
|
||||||
SimpleGrid,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useViewportSize } from "@mantine/hooks";
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
|
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
|
||||||
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
|
|
||||||
import ComponentDonasi_IsEmptyData from "../../component/is_empty_data";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import { ComponentDonasi_CardStatus } from "../../component/card_view/card_status";
|
||||||
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
|
|
||||||
export default function PostingDraftDonasi({
|
export default function PostingDraftDonasi({
|
||||||
listDraft,
|
listDraft,
|
||||||
}: {
|
}: {
|
||||||
listDraft: MODEL_DONASI[];
|
listDraft: MODEL_DONASI[];
|
||||||
}) {
|
}) {
|
||||||
const { height, width } = useViewportSize();
|
if (_.isEmpty(listDraft)) return <ComponentGlobal_IsEmptyData />;
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
if (_.isEmpty(listDraft))
|
|
||||||
return <ComponentDonasi_IsEmptyData text="Tidak ada data" />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SimpleGrid
|
{listDraft.map((e, i) => (
|
||||||
cols={4}
|
<Box key={i}>
|
||||||
spacing="lg"
|
<ComponentDonasi_CardStatus
|
||||||
breakpoints={[
|
data={e}
|
||||||
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
path={RouterDonasi.detail_draft}
|
||||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
/>
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
</Box>
|
||||||
]}
|
))}
|
||||||
>
|
|
||||||
{listDraft.map((e, i) => (
|
|
||||||
<Box
|
|
||||||
key={i}
|
|
||||||
onClick={() => router.push(RouterDonasi.detail_draft + `${e.id}`)}
|
|
||||||
>
|
|
||||||
<Stack>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={7}>
|
|
||||||
<AspectRatio ratio={16 / 9}>
|
|
||||||
<Paper radius={"md"}>
|
|
||||||
<Image
|
|
||||||
alt="Foto"
|
|
||||||
src={RouterDonasi.api_gambar + `${e.imagesId}`}
|
|
||||||
radius={"md"}
|
|
||||||
/>
|
|
||||||
</Paper>
|
|
||||||
</AspectRatio>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={5}>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Text fz={"sm"} fw={"bold"} lineClamp={2}>
|
|
||||||
{e.title}
|
|
||||||
</Text>
|
|
||||||
<Stack spacing={0}>
|
|
||||||
<Text fz={"sm"}>Terget Dana</Text>
|
|
||||||
<Text fz={"sm"} fw={"bold"} c={"orange"} truncate>
|
|
||||||
<TampilanRupiahDonasi nominal={+e.target} />
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
{width > 575 ? "" : <Divider />}
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
))}
|
|
||||||
</SimpleGrid>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,40 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import {
|
import ComponentDonasi_CardPublish from "../../component/card_view/box_publish";
|
||||||
AspectRatio,
|
|
||||||
Box,
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Center,
|
|
||||||
Divider,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Image,
|
|
||||||
Paper,
|
|
||||||
Progress,
|
|
||||||
SimpleGrid,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useViewportSize } from "@mantine/hooks";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import ComponentDonasi_TampilanHitungMundur from "../../component/tampilan_hitung_mundur";
|
import _ from "lodash";
|
||||||
import ComponentDonasi_BoxPublish from "../../component/box_publish";
|
import { Box } from "@mantine/core";
|
||||||
|
|
||||||
export default function PostingPublishDonasi({
|
export default function PostingPublishDonasi({
|
||||||
listPublish,
|
listPublish,
|
||||||
}: {
|
}: {
|
||||||
listPublish: MODEL_DONASI[];
|
listPublish: MODEL_DONASI[];
|
||||||
}) {
|
}) {
|
||||||
|
const [data, setData] = useState(listPublish);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ComponentDonasi_BoxPublish dataDonasi={listPublish} path={RouterDonasi.detail_publish} />
|
{_.isEmpty(data) ? (
|
||||||
|
<ComponentGlobal_IsEmptyData />
|
||||||
|
) : (
|
||||||
|
data.map((e, i) => (
|
||||||
|
<Box key={i}>
|
||||||
|
<ComponentDonasi_CardPublish
|
||||||
|
data={e}
|
||||||
|
path={RouterDonasi.detail_publish}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
))
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// return (
|
||||||
|
// <>
|
||||||
|
// <ComponentDonasi_CardPublish dataDonasi={listPublish} path={RouterDonasi.detail_publish} />
|
||||||
|
// </>
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
|||||||
import {
|
import {
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Box,
|
Box,
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Center,
|
|
||||||
Divider,
|
Divider,
|
||||||
Grid,
|
Grid,
|
||||||
Image,
|
Image,
|
||||||
@@ -14,78 +11,88 @@ import {
|
|||||||
SimpleGrid,
|
SimpleGrid,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useViewportSize } from "@mantine/hooks";
|
import { useViewportSize } from "@mantine/hooks";
|
||||||
|
import _ from "lodash";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentDonasi_IsEmptyData from "../../component/is_empty_data";
|
import ComponentDonasi_IsEmptyData from "../../component/is_empty_data";
|
||||||
import _ from "lodash";
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
|
import { ComponentDonasi_CardStatus } from "../../component/card_view/card_status";
|
||||||
|
|
||||||
export default function PostingRejectDonasi({
|
export default function PostingRejectDonasi({
|
||||||
listReject,
|
listReject,
|
||||||
}: {
|
}: {
|
||||||
listReject: MODEL_DONASI[];
|
listReject: MODEL_DONASI[];
|
||||||
}) {
|
}) {
|
||||||
const { height, width } = useViewportSize();
|
const [data, setData] = useState(listReject);
|
||||||
const router = useRouter();
|
|
||||||
const [donasi, setDonasi] = useState(listReject);
|
|
||||||
|
|
||||||
if (_.isEmpty(listReject))
|
|
||||||
return <ComponentDonasi_IsEmptyData text="Tidak ada data" />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SimpleGrid
|
{data.map((e, i) => (
|
||||||
cols={4}
|
<Box key={i}>
|
||||||
spacing="lg"
|
<ComponentDonasi_CardStatus
|
||||||
breakpoints={[
|
data={e}
|
||||||
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
path={RouterDonasi.detail_reject}
|
||||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
/>
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
</Box>
|
||||||
]}
|
))}
|
||||||
>
|
|
||||||
{donasi.map((e, i) => (
|
|
||||||
<Box
|
|
||||||
key={i}
|
|
||||||
onClick={() => router.push(RouterDonasi.detail_reject + `${e.id}`)}
|
|
||||||
>
|
|
||||||
<Stack>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={7}>
|
|
||||||
<AspectRatio ratio={16 / 9}>
|
|
||||||
<Paper radius={"md"}>
|
|
||||||
<Image
|
|
||||||
alt="Foto"
|
|
||||||
src={RouterDonasi.api_gambar + `${e.imagesId}`}
|
|
||||||
radius={"md"}
|
|
||||||
/>
|
|
||||||
</Paper>
|
|
||||||
</AspectRatio>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={5}>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Text fz={"sm"} fw={"bold"} lineClamp={2}>
|
|
||||||
{e.title}
|
|
||||||
</Text>
|
|
||||||
<Stack spacing={0}>
|
|
||||||
<Text fz={"sm"} fw={"bold"}>
|
|
||||||
Alasan ditolak
|
|
||||||
</Text>
|
|
||||||
<Text fz={"sm"} lineClamp={2}>
|
|
||||||
{e.catatan}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
{width > 575 ? "" : <Divider />}
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
))}
|
|
||||||
</SimpleGrid>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// if (_.isEmpty(listReject))
|
||||||
|
// return <ComponentDonasi_IsEmptyData text="Tidak ada data" />;
|
||||||
|
|
||||||
|
// return (
|
||||||
|
// <>
|
||||||
|
// <SimpleGrid
|
||||||
|
// cols={4}
|
||||||
|
// spacing="lg"
|
||||||
|
// breakpoints={[
|
||||||
|
// { maxWidth: "62rem", cols: 3, spacing: "md" },
|
||||||
|
// { maxWidth: "48rem", cols: 2, spacing: "sm" },
|
||||||
|
// { maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||||
|
// ]}
|
||||||
|
// >
|
||||||
|
// {donasi.map((e, i) => (
|
||||||
|
// <Box
|
||||||
|
// key={i}
|
||||||
|
// onClick={() => router.push(RouterDonasi.detail_reject + `${e.id}`)}
|
||||||
|
// >
|
||||||
|
// <Stack>
|
||||||
|
// <Grid>
|
||||||
|
// <Grid.Col span={7}>
|
||||||
|
// <AspectRatio ratio={16 / 9}>
|
||||||
|
// <Paper radius={"md"}>
|
||||||
|
// <Image
|
||||||
|
// alt="Foto"
|
||||||
|
// src={RouterDonasi.api_gambar + `${e.imagesId}`}
|
||||||
|
// radius={"md"}
|
||||||
|
// />
|
||||||
|
// </Paper>
|
||||||
|
// </AspectRatio>
|
||||||
|
// </Grid.Col>
|
||||||
|
// <Grid.Col span={5}>
|
||||||
|
// <Stack spacing={"xs"}>
|
||||||
|
// <Text fz={"sm"} fw={"bold"} lineClamp={2}>
|
||||||
|
// {e.title}
|
||||||
|
// </Text>
|
||||||
|
// <Stack spacing={0}>
|
||||||
|
// <Text fz={"sm"} fw={"bold"}>
|
||||||
|
// Alasan ditolak
|
||||||
|
// </Text>
|
||||||
|
// <Text fz={"sm"} lineClamp={2}>
|
||||||
|
// {e.catatan}
|
||||||
|
// </Text>
|
||||||
|
// </Stack>
|
||||||
|
// </Stack>
|
||||||
|
// </Grid.Col>
|
||||||
|
// </Grid>
|
||||||
|
// {width > 575 ? "" : <Divider />}
|
||||||
|
// </Stack>
|
||||||
|
// </Box>
|
||||||
|
// ))}
|
||||||
|
// </SimpleGrid>
|
||||||
|
// </>
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,92 +1,29 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import {
|
import { Box } from "@mantine/core";
|
||||||
AspectRatio,
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
Box,
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Center,
|
|
||||||
Divider,
|
|
||||||
Grid,
|
|
||||||
Image,
|
|
||||||
Paper,
|
|
||||||
Progress,
|
|
||||||
SimpleGrid,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useViewportSize } from "@mantine/hooks";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
|
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import ComponentDonasi_IsEmptyData from "../../component/is_empty_data";
|
import { ComponentDonasi_CardStatus } from "../../component/card_view/card_status";
|
||||||
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
|
|
||||||
export default function PostingReviewDonasi({
|
export default function PostingReviewDonasi({
|
||||||
listReview,
|
listReview,
|
||||||
}: {
|
}: {
|
||||||
listReview: MODEL_DONASI[];
|
listReview: MODEL_DONASI[];
|
||||||
}) {
|
}) {
|
||||||
const { height, width } = useViewportSize();
|
if (_.isEmpty(listReview)) return <ComponentGlobal_IsEmptyData />;
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
if (_.isEmpty(listReview))
|
|
||||||
return <ComponentDonasi_IsEmptyData text="Tidak ada data" />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SimpleGrid
|
{listReview.map((e, i) => (
|
||||||
cols={4}
|
<Box key={i}>
|
||||||
spacing="lg"
|
<ComponentDonasi_CardStatus
|
||||||
breakpoints={[
|
data={e}
|
||||||
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
path={RouterDonasi.detail_review}
|
||||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
/>
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
</Box>
|
||||||
]}
|
))}
|
||||||
>
|
|
||||||
{listReview.map((e, i) => (
|
|
||||||
<Box
|
|
||||||
key={i}
|
|
||||||
onClick={() => router.push(RouterDonasi.detail_review + `${e.id}`)}
|
|
||||||
>
|
|
||||||
<Stack>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={7}>
|
|
||||||
<AspectRatio ratio={16 / 9}>
|
|
||||||
<Paper radius={"md"} bg={"gray.1"}>
|
|
||||||
<Image
|
|
||||||
alt="Foto"
|
|
||||||
src={RouterDonasi.api_gambar + `${e.imagesId}`}
|
|
||||||
radius={"md"}
|
|
||||||
/>
|
|
||||||
</Paper>
|
|
||||||
</AspectRatio>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={5}>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Text fz={"sm"} fw={"bold"} lineClamp={2}>
|
|
||||||
{e.title}
|
|
||||||
</Text>
|
|
||||||
<Stack spacing={0}>
|
|
||||||
<Text fz={"sm"}>Terget Dana</Text>
|
|
||||||
<Text fz={"sm"} fw={"bold"} c={"orange"} truncate>
|
|
||||||
Rp.{" "}
|
|
||||||
{new Intl.NumberFormat("id-ID", {
|
|
||||||
maximumFractionDigits: 10,
|
|
||||||
}).format(+e.target)}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
{width > 575 ? "" : <Divider />}
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
))}
|
|
||||||
</SimpleGrid>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
109
src/app_modules/donasi/main/galang_dana/ui_galang_dana.tsx
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Stack,
|
||||||
|
Tabs,
|
||||||
|
Text
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { useAtom } from "jotai";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { gs_donasi_tabs_posting } from "../../global_state";
|
||||||
|
import PostingDraftDonasi from "./draft";
|
||||||
|
import PostingPublishDonasi from "./publish";
|
||||||
|
import PostingRejectDonasi from "./reject";
|
||||||
|
import PostingReviewDonasi from "./review";
|
||||||
|
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
|
export default function GalangDanaDonasi({
|
||||||
|
listPublish,
|
||||||
|
listReview,
|
||||||
|
listDraft,
|
||||||
|
listReject,
|
||||||
|
}: {
|
||||||
|
listPublish: any;
|
||||||
|
listReview: any;
|
||||||
|
listDraft: any;
|
||||||
|
listReject: any;
|
||||||
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
|
const [tabsPostingDonasi, setTabsPostingDonasi] = useAtom(
|
||||||
|
gs_donasi_tabs_posting
|
||||||
|
);
|
||||||
|
|
||||||
|
const listPosting = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
value: "Publish",
|
||||||
|
path: <PostingPublishDonasi listPublish={listPublish} />,
|
||||||
|
color: "green",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
value: "Review",
|
||||||
|
path: <PostingReviewDonasi listReview={listReview} />,
|
||||||
|
color: "yellow",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
value: "Draft",
|
||||||
|
path: <PostingDraftDonasi listDraft={listDraft} />,
|
||||||
|
color: "red",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
value: "Reject",
|
||||||
|
path: <PostingRejectDonasi listReject={listReject} />,
|
||||||
|
color: "red",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Tabs
|
||||||
|
color="orange"
|
||||||
|
variant="pills"
|
||||||
|
radius="xl"
|
||||||
|
defaultValue="Publish"
|
||||||
|
value={tabsPostingDonasi}
|
||||||
|
onTabChange={setTabsPostingDonasi}
|
||||||
|
styles={{
|
||||||
|
tabsList: {
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
position: "sticky",
|
||||||
|
top: 0,
|
||||||
|
zIndex: 99,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Stack>
|
||||||
|
<Tabs.List grow>
|
||||||
|
{listPosting.map((e, i) => (
|
||||||
|
<Tabs.Tab
|
||||||
|
key={e.id}
|
||||||
|
value={e.value}
|
||||||
|
fw={"bold"}
|
||||||
|
c={"black"}
|
||||||
|
style={{
|
||||||
|
transition: "0.5s",
|
||||||
|
backgroundColor:
|
||||||
|
tabsPostingDonasi === e.value ? MainColor.yellow : "white",
|
||||||
|
border:
|
||||||
|
tabsPostingDonasi === e.value
|
||||||
|
? `1px solid ${AccentColor.yellow}`
|
||||||
|
: `1px solid white`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{e.value}
|
||||||
|
</Tabs.Tab>
|
||||||
|
))}
|
||||||
|
</Tabs.List>
|
||||||
|
{listPosting.map((e, i) => (
|
||||||
|
<Tabs.Panel key={e.id} value={e.value} pt="xs">
|
||||||
|
{e.path}
|
||||||
|
</Tabs.Panel>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
</Tabs>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,30 +1,22 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import {
|
|
||||||
ActionIcon,
|
|
||||||
Center,
|
|
||||||
Flex,
|
|
||||||
Footer,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Header,
|
|
||||||
Text,
|
|
||||||
Title
|
|
||||||
} from "@mantine/core";
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
|
||||||
import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import {
|
import {
|
||||||
IconChevronLeft,
|
|
||||||
IconGiftCardFilled,
|
IconGiftCardFilled,
|
||||||
IconHome,
|
IconHome,
|
||||||
IconMoneybag
|
IconMoneybag,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { gs_donasi_hot_menu } from "../global_state";
|
import { gs_donasi_hot_menu } from "../global_state";
|
||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
|
import { SimpleGrid, Stack, ActionIcon, Text } from "@mantine/core";
|
||||||
|
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||||
|
import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
|
||||||
|
|
||||||
export default function LayoutDonasi({
|
export default function LayoutDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -40,7 +32,7 @@ export default function LayoutDonasi({
|
|||||||
const [isLoading, setLoading] = useState(false);
|
const [isLoading, setLoading] = useState(false);
|
||||||
const [isRightLoading, setRightLoading] = useState(false);
|
const [isRightLoading, setRightLoading] = useState(false);
|
||||||
|
|
||||||
const listPage = [
|
const listFooter = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: "Beranda",
|
name: "Beranda",
|
||||||
@@ -63,80 +55,122 @@ export default function LayoutDonasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={
|
header={
|
||||||
<Header height={50} sx={{ borderStyle: "none" }}>
|
<UIGlobal_LayoutHeaderTamplate
|
||||||
<Group h={50} position="apart" px={"md"}>
|
title="Donasi"
|
||||||
<ActionIcon
|
routerLeft={RouterCrowd.main}
|
||||||
radius={"xl"}
|
/>
|
||||||
variant="transparent"
|
|
||||||
loading={isLoading ? true : false}
|
|
||||||
onClick={() => {
|
|
||||||
setLoading(true);
|
|
||||||
router.push(RouterCrowd.main);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<IconChevronLeft />
|
|
||||||
</ActionIcon>
|
|
||||||
<Title order={5}>Donasi</Title>
|
|
||||||
<ActionIcon disabled variant="transparent"/>
|
|
||||||
{/* <ActionIcon
|
|
||||||
radius={"md"}
|
|
||||||
loading={isRightLoading ? true : false}
|
|
||||||
variant="transparent"
|
|
||||||
onClick={() => {
|
|
||||||
setRightLoading(true);
|
|
||||||
router.push(RouterDonasi.notif_page + `${userId}`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{_.isEmpty(isRead) ? (
|
|
||||||
<IconBell />
|
|
||||||
) : isRead.includes(false) ? (
|
|
||||||
<Indicator processing color="orange">
|
|
||||||
<IconBell />
|
|
||||||
</Indicator>
|
|
||||||
) : (
|
|
||||||
<IconBell />
|
|
||||||
)}
|
|
||||||
</ActionIcon> */}
|
|
||||||
</Group>
|
|
||||||
</Header>
|
|
||||||
}
|
}
|
||||||
footer={
|
footer={
|
||||||
<Footer height={"10vh"} bg={"dark"}>
|
<SimpleGrid cols={listFooter.length} h={"9vh"} mx={"xs"}>
|
||||||
<Grid align="center" h={"10vh"} pt={"xs"} grow>
|
{listFooter.map((e, i) => (
|
||||||
{/* Tampilan Bursa */}
|
<Stack key={i} align="center" justify="center" spacing={0}>
|
||||||
{listPage.map((e, i) => (
|
<ActionIcon
|
||||||
<Grid.Col
|
// disabled={e.path === "" ? true : false}
|
||||||
key={e.id}
|
variant="transparent"
|
||||||
span={3}
|
c={active === i ? MainColor.yellow : "white"}
|
||||||
onClick={() => {
|
onClick={() =>
|
||||||
router.push(e.path);
|
e.path === ""
|
||||||
setActive(i);
|
? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
|
||||||
}}
|
: (router.replace(e.path), setActive(i))
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Center>
|
{e.icon}
|
||||||
<Flex direction={"column"} align={"center"} w={"100%"}>
|
</ActionIcon>
|
||||||
<ActionIcon
|
<Text
|
||||||
variant="transparent"
|
c={active === i ? MainColor.yellow : "white"}
|
||||||
c={active === i ? "orange" : "white"}
|
fz={"xs"}
|
||||||
>
|
lineClamp={1}
|
||||||
{e.icon}
|
>
|
||||||
</ActionIcon>
|
{e.name}
|
||||||
<Text c={active === i ? "orange" : "white"} fz={"xs"}>
|
</Text>
|
||||||
{e.name}
|
</Stack>
|
||||||
</Text>
|
))}
|
||||||
</Flex>
|
</SimpleGrid>
|
||||||
</Center>
|
|
||||||
</Grid.Col>
|
|
||||||
))}
|
|
||||||
</Grid>
|
|
||||||
</Footer>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{/* {JSON.stringify(isRead)} */}
|
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// return (
|
||||||
|
// <>
|
||||||
|
// <AppComponentGlobal_LayoutTamplate
|
||||||
|
// header={
|
||||||
|
// <Header height={50} sx={{ borderStyle: "none" }}>
|
||||||
|
// <Group h={50} position="apart" px={"md"}>
|
||||||
|
// <ActionIcon
|
||||||
|
// radius={"xl"}
|
||||||
|
// variant="transparent"
|
||||||
|
// loading={isLoading ? true : false}
|
||||||
|
// onClick={() => {
|
||||||
|
// setLoading(true);
|
||||||
|
// router.push(RouterCrowd.main);
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// <IconChevronLeft />
|
||||||
|
// </ActionIcon>
|
||||||
|
// <Title order={5}>Donasi</Title>
|
||||||
|
// <ActionIcon disabled variant="transparent" />
|
||||||
|
// {/* <ActionIcon
|
||||||
|
// radius={"md"}
|
||||||
|
// loading={isRightLoading ? true : false}
|
||||||
|
// variant="transparent"
|
||||||
|
// onClick={() => {
|
||||||
|
// setRightLoading(true);
|
||||||
|
// router.push(RouterDonasi.notif_page + `${userId}`);
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// {_.isEmpty(isRead) ? (
|
||||||
|
// <IconBell />
|
||||||
|
// ) : isRead.includes(false) ? (
|
||||||
|
// <Indicator processing color="orange">
|
||||||
|
// <IconBell />
|
||||||
|
// </Indicator>
|
||||||
|
// ) : (
|
||||||
|
// <IconBell />
|
||||||
|
// )}
|
||||||
|
// </ActionIcon> */}
|
||||||
|
// </Group>
|
||||||
|
// </Header>
|
||||||
|
// }
|
||||||
|
// footer={
|
||||||
|
// <Footer height={"10vh"} bg={"dark"}>
|
||||||
|
// <Grid align="center" h={"10vh"} pt={"xs"} grow>
|
||||||
|
// {/* Tampilan Bursa */}
|
||||||
|
// {listPage.map((e, i) => (
|
||||||
|
// <Grid.Col
|
||||||
|
// key={e.id}
|
||||||
|
// span={3}
|
||||||
|
// onClick={() => {
|
||||||
|
// router.push(e.path);
|
||||||
|
// setActive(i);
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// <Center>
|
||||||
|
// <Flex direction={"column"} align={"center"} w={"100%"}>
|
||||||
|
// <ActionIcon
|
||||||
|
// variant="transparent"
|
||||||
|
// c={active === i ? "orange" : "white"}
|
||||||
|
// >
|
||||||
|
// {e.icon}
|
||||||
|
// </ActionIcon>
|
||||||
|
// <Text c={active === i ? "orange" : "white"} fz={"xs"}>
|
||||||
|
// {e.name}
|
||||||
|
// </Text>
|
||||||
|
// </Flex>
|
||||||
|
// </Center>
|
||||||
|
// </Grid.Col>
|
||||||
|
// ))}
|
||||||
|
// </Grid>
|
||||||
|
// </Footer>
|
||||||
|
// }
|
||||||
|
// >
|
||||||
|
// {/* {JSON.stringify(isRead)} */}
|
||||||
|
// {children}
|
||||||
|
// </AppComponentGlobal_LayoutTamplate>
|
||||||
|
// </>
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import { Box, Stack, Title } from "@mantine/core";
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
|
import { Stack, Title } from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconCircleCheck } from "@tabler/icons-react";
|
import { IconCircleCheck } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
@@ -9,14 +11,26 @@ import { useRouter } from "next/navigation";
|
|||||||
export default function PagePopUpCreateDonasi() {
|
export default function PagePopUpCreateDonasi() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
setTimeout(() => router.push(RouterDonasi.main_galang_dana), 2000);
|
setTimeout(
|
||||||
|
() => router.push(RouterDonasi.main_galang_dana, { scroll: false }),
|
||||||
|
2000
|
||||||
|
);
|
||||||
}, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack h={"80vh"} align="center" justify="center">
|
<UIGlobal_LayoutTamplate>
|
||||||
<IconCircleCheck size={100} color="green" />
|
<Stack h={"80vh"} align="center" justify="center">
|
||||||
<Title order={3}>Berhasil Membuat Pengalangan Dana</Title>
|
<IconCircleCheck
|
||||||
</Stack>
|
size={100}
|
||||||
|
style={{
|
||||||
|
color: MainColor.yellow,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Title order={3} c={"white"}>
|
||||||
|
Berhasil Membuat Pengalangan Dana
|
||||||
|
</Title>
|
||||||
|
</Stack>
|
||||||
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import {
|
import {
|
||||||
Box,
|
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
CopyButton,
|
CopyButton,
|
||||||
FileButton,
|
FileButton,
|
||||||
FileInput,
|
|
||||||
Grid,
|
Grid,
|
||||||
Group,
|
Group,
|
||||||
Paper,
|
Paper,
|
||||||
@@ -14,21 +13,22 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
|
import { IconCamera, IconCircleCheck } from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { gs_donasi_hot_menu, gs_proses_donasi } from "../../global_state";
|
|
||||||
import { MODEL_DONASI, MODEL_DONASI_INVOICE } from "../../model/interface";
|
|
||||||
import { useState } from "react";
|
|
||||||
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
|
|
||||||
import ComponentDonasi_TampilanHitungMundur from "../../component/tampilan_hitung_mundur";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
|
||||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||||
import { Donasi_funUpdateStatusInvoice } from "../../fun/update/fun_update_status_invoice";
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
||||||
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
||||||
|
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
|
||||||
import { Donasi_funUploadBuktiTransferById } from "../../fun/update/fun_update_invoice";
|
import { Donasi_funUploadBuktiTransferById } from "../../fun/update/fun_update_invoice";
|
||||||
import { buffer } from "stream/consumers";
|
import { Donasi_funUpdateStatusInvoice } from "../../fun/update/fun_update_status_invoice";
|
||||||
import { IconCamera, IconCheck, IconCircleCheck } from "@tabler/icons-react";
|
import { gs_donasi_hot_menu } from "../../global_state";
|
||||||
|
import { MODEL_DONASI_INVOICE } from "../../model/interface";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function Donasi_InvoiceProses({
|
export default function Donasi_InvoiceProses({
|
||||||
dataInvoice,
|
dataInvoice,
|
||||||
@@ -43,8 +43,18 @@ export default function Donasi_InvoiceProses({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"lg"}>
|
<Stack spacing={"lg"} py={"md"}>
|
||||||
<Stack spacing={0}>
|
<Stack
|
||||||
|
spacing={0}
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Title order={5}>Mohon transfer ke rekening dibawah</Title>
|
<Title order={5}>Mohon transfer ke rekening dibawah</Title>
|
||||||
<Group spacing={"xs"}>
|
<Group spacing={"xs"}>
|
||||||
<Text>untuk diteruskan ke </Text>
|
<Text>untuk diteruskan ke </Text>
|
||||||
@@ -52,17 +62,38 @@ export default function Donasi_InvoiceProses({
|
|||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Paper p={"sm"} withBorder>
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack spacing={"md"}>
|
<Stack spacing={"md"}>
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text>Bank {invoice.DonasiMaster_Bank.name}</Text>
|
<Text>Bank {invoice.DonasiMaster_Bank.name}</Text>
|
||||||
<Text>PT. Himpunan Pengusaha Badung</Text>
|
<Text>PT. Himpunan Pengusaha Badung</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Paper bg={"gray.1"} p={"sm"} radius={"md"}>
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.softblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={8}>
|
<Grid.Col span={8}>
|
||||||
<Group position="left" align="center" h={"100%"}>
|
<Group position="left" align="center" h={"100%"}>
|
||||||
<Title order={4}>{invoice.DonasiMaster_Bank.norek}</Title>
|
<Title order={4} color={MainColor.yellow}>
|
||||||
|
{invoice.DonasiMaster_Bank.norek}
|
||||||
|
</Title>
|
||||||
</Group>
|
</Group>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={4}>
|
<Grid.Col span={4}>
|
||||||
@@ -70,10 +101,12 @@ export default function Donasi_InvoiceProses({
|
|||||||
<CopyButton value={invoice.DonasiMaster_Bank.norek}>
|
<CopyButton value={invoice.DonasiMaster_Bank.norek}>
|
||||||
{({ copied, copy }) => (
|
{({ copied, copy }) => (
|
||||||
<Button
|
<Button
|
||||||
color={copied ? "teal" : "blue"}
|
style={{
|
||||||
variant="outline"
|
transition: "0.5s",
|
||||||
|
}}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={copy}
|
onClick={copy}
|
||||||
|
color={copied ? "teal" : "yellow"}
|
||||||
>
|
>
|
||||||
{copied ? "Berhasil" : "Salin"}
|
{copied ? "Berhasil" : "Salin"}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -86,16 +119,35 @@ export default function Donasi_InvoiceProses({
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
<Paper p={"sm"} withBorder>
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack spacing={"md"}>
|
<Stack spacing={"md"}>
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text>Jumlah transfer</Text>
|
<Text>Jumlah transfer</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Paper bg={"gray.1"} p={"sm"} radius={"md"}>
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.softblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={8}>
|
<Grid.Col span={8}>
|
||||||
<Group position="left" align="center" h={"100%"}>
|
<Group position="left" align="center" h={"100%"}>
|
||||||
<Title order={4}>
|
<Title order={4} color="white">
|
||||||
<TampilanRupiahDonasi nominal={+(+invoice.nominal)} />
|
<TampilanRupiahDonasi nominal={+(+invoice.nominal)} />
|
||||||
</Title>
|
</Title>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -105,9 +157,12 @@ export default function Donasi_InvoiceProses({
|
|||||||
<CopyButton value={"" + +invoice.nominal}>
|
<CopyButton value={"" + +invoice.nominal}>
|
||||||
{({ copied, copy }) => (
|
{({ copied, copy }) => (
|
||||||
<Button
|
<Button
|
||||||
color={copied ? "teal" : "blue"}
|
style={{
|
||||||
variant="outline"
|
transition: "0.5s",
|
||||||
|
}}
|
||||||
|
variant="filled"
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
|
color={copied ? "teal" : "yellow"}
|
||||||
onClick={copy}
|
onClick={copy}
|
||||||
>
|
>
|
||||||
{copied ? "Berhasil" : "Salin"}
|
{copied ? "Berhasil" : "Salin"}
|
||||||
@@ -118,13 +173,23 @@ export default function Donasi_InvoiceProses({
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Paper>
|
</Paper>
|
||||||
<Text fz={"xs"} c={"gray"}>
|
{/* <Text fz={"xs"} c={"gray"}>
|
||||||
Sudah termasuk biaya admin Rp. 2.500,-
|
Sudah termasuk biaya admin Rp. 2.500,-
|
||||||
</Text>
|
</Text> */}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
<Paper p={"md"} withBorder>
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack spacing={"sm"}>
|
<Stack spacing={"sm"}>
|
||||||
<Center>
|
<Center>
|
||||||
<FileButton
|
<FileButton
|
||||||
@@ -147,9 +212,9 @@ export default function Donasi_InvoiceProses({
|
|||||||
<Button
|
<Button
|
||||||
{...props}
|
{...props}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
variant="outline"
|
|
||||||
w={150}
|
|
||||||
leftIcon={<IconCamera />}
|
leftIcon={<IconCamera />}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</Button>
|
</Button>
|
||||||
@@ -178,8 +243,9 @@ export default function Donasi_InvoiceProses({
|
|||||||
{file !== null ? (
|
{file !== null ? (
|
||||||
<Button
|
<Button
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
bg={"orange"}
|
bg={MainColor.yellow}
|
||||||
color="orange"
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
onClick={() => onClick(router, invoice.id, setActive)}
|
onClick={() => onClick(router, invoice.id, setActive)}
|
||||||
>
|
>
|
||||||
Saya Sudah Transfer
|
Saya Sudah Transfer
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import { useAtom } from "jotai";
|
|||||||
import { title } from "process";
|
import { title } from "process";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
|
||||||
export default function LayoutDonasi_InvoiceProses({
|
export default function LayoutDonasi_InvoiceProses({
|
||||||
children,
|
children,
|
||||||
@@ -25,21 +27,20 @@ export default function LayoutDonasi_InvoiceProses({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={
|
header={
|
||||||
<Header height={50} sx={{ borderStyle: "none" }}>
|
<UIGlobal_LayoutHeaderTamplate
|
||||||
<Group h={50} position="apart" px={"md"}>
|
title="Invoice"
|
||||||
|
customButtonLeft={
|
||||||
<ActionIcon variant="transparent" onClick={() => onClick()}>
|
<ActionIcon variant="transparent" onClick={() => onClick()}>
|
||||||
<IconX />
|
<IconX color="white"/>
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
<Title order={5}>Invoice</Title>
|
}
|
||||||
<ActionIcon disabled variant="transparent"></ActionIcon>
|
/>
|
||||||
</Group>
|
|
||||||
</Header>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Grid,
|
|
||||||
Group,
|
Group,
|
||||||
NumberInput,
|
|
||||||
Paper,
|
Paper,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
TextInput,
|
TextInput,
|
||||||
Title,
|
Title
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
import {
|
||||||
IconChevronRight,
|
IconChevronRight,
|
||||||
@@ -20,10 +22,10 @@ import {
|
|||||||
IconMoodSmileDizzy,
|
IconMoodSmileDizzy,
|
||||||
IconMoodXd,
|
IconMoodXd,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { gs_proses_donasi } from "../../global_state";
|
import { gs_proses_donasi } from "../../global_state";
|
||||||
|
|
||||||
const listNominal = [
|
const listNominal = [
|
||||||
@@ -75,12 +77,16 @@ export default function MasukanDonasi({ donasiId }: { donasiId: string }) {
|
|||||||
{listNominal.map((e) => (
|
{listNominal.map((e) => (
|
||||||
<Paper
|
<Paper
|
||||||
key={e.id}
|
key={e.id}
|
||||||
withBorder
|
|
||||||
radius={"md"}
|
|
||||||
p={"sm"}
|
|
||||||
shadow="lg"
|
|
||||||
mb={"md"}
|
|
||||||
onClick={() => onProses(e.jumlah)}
|
onClick={() => onProses(e.jumlah)}
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Group>
|
<Group>
|
||||||
@@ -97,7 +103,17 @@ export default function MasukanDonasi({ donasiId }: { donasiId: string }) {
|
|||||||
</Paper>
|
</Paper>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
<Paper p={"sm"} withBorder shadow="lg">
|
|
||||||
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text>Nominal Lainnya</Text>
|
<Text>Nominal Lainnya</Text>
|
||||||
<TextInput
|
<TextInput
|
||||||
@@ -133,6 +149,9 @@ export default function MasukanDonasi({ donasiId }: { donasiId: string }) {
|
|||||||
disabled={value === 0 || value < 10000}
|
disabled={value === 0 || value < 10000}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => onProses(value)}
|
onClick={() => onProses(value)}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Lanjutan Pembayaran
|
Lanjutan Pembayaran
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||