# fix
- Ganti Appshell dengan tamplate buatan sendiri di modul donasi ## No Issuue
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutEditCeritaPenggalangDonasi({
|
||||
children,
|
||||
@@ -11,9 +12,9 @@ export default function LayoutEditCeritaPenggalangDonasi({
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentDonasi_HeaderTamplate title="Update Cerita Penggalang" />}>
|
||||
<AppComponentGlobal_LayoutTamplate header={<ComponentDonasi_HeaderTamplate title="Update Cerita Penggalang" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutEditDonasi({
|
||||
children,
|
||||
@@ -11,9 +12,9 @@ export default function LayoutEditDonasi({
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentDonasi_HeaderTamplate title="Edit Donasi" />}>
|
||||
<AppComponentGlobal_LayoutTamplate header={<ComponentDonasi_HeaderTamplate title="Edit Donasi" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutDonasi_EditRekening({
|
||||
children,
|
||||
@@ -11,11 +12,11 @@ export default function LayoutDonasi_EditRekening({
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={<ComponentDonasi_HeaderTamplate title="Edit Rekening" />}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import ComponentDonasi_HeaderTamplate from "@/app_modules/donasi/component/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
@@ -11,10 +12,10 @@ export default function LayoutListKabarDonasi({
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={<ComponentDonasi_HeaderTamplate title="List Kabar" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,19 +17,20 @@ import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.share
|
||||
import { Donasi_funDeleteKabar } from "../../fun/delete/fun_delete.kabar";
|
||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
||||
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutUpdateKabarDonasi({
|
||||
children,
|
||||
kabarId
|
||||
kabarId,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
kabarId: string
|
||||
kabarId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={<ComponentDonasi_HeaderTamplate title="Update Kabar" />}
|
||||
footer={
|
||||
<Footer height={70}>
|
||||
@@ -37,7 +38,12 @@ export default function LayoutUpdateKabarDonasi({
|
||||
{/* <Button radius={"xl"} variant="outline" color="green">
|
||||
Edit
|
||||
</Button> */}
|
||||
<Button radius={"xl"} variant="outline" color="red" onClick={() => onDelete(router,kabarId )}>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
variant="outline"
|
||||
color="red"
|
||||
onClick={() => onDelete(router, kabarId)}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
</Group>
|
||||
@@ -45,19 +51,18 @@ export default function LayoutUpdateKabarDonasi({
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onDelete(router: AppRouterInstance ,kabarId: string) {
|
||||
await Donasi_funDeleteKabar(kabarId)
|
||||
.then((res) => {
|
||||
if(res.status === 200){
|
||||
router.back()
|
||||
NotifBerhasil(res.message)
|
||||
async function onDelete(router: AppRouterInstance, kabarId: string) {
|
||||
await Donasi_funDeleteKabar(kabarId).then((res) => {
|
||||
if (res.status === 200) {
|
||||
router.back();
|
||||
NotifBerhasil(res.message);
|
||||
} else {
|
||||
NotifGagal(res.message)
|
||||
NotifGagal(res.message);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user