From 10cf9c3a467a79ba2442582722827c00a6d966ce Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Wed, 22 May 2024 16:27:43 +0800 Subject: [PATCH] QC Job # fix - Loading card - Loading button - Size image - Mandatori form - Share wa ## No Issuu --- .../component_global/loading_card.tsx | 25 +++++++++++++++ .../job/component/card_view_status.tsx | 18 +++++++++-- src/app_modules/job/detail/arsip/view.tsx | 5 +++ src/app_modules/job/detail/publish/view.tsx | 6 ++++ src/app_modules/job/main/beranda.tsx | 13 +++----- src/app_modules/job/main/layout.tsx | 18 ++++++++--- src/app_modules/job/main/status/draft.tsx | 7 +++-- src/app_modules/job/main/status/publish.tsx | 31 +------------------ src/util/app_config.ts | 2 +- 9 files changed, 78 insertions(+), 47 deletions(-) create mode 100644 src/app_modules/component_global/loading_card.tsx diff --git a/src/app_modules/component_global/loading_card.tsx b/src/app_modules/component_global/loading_card.tsx new file mode 100644 index 00000000..ff43d946 --- /dev/null +++ b/src/app_modules/component_global/loading_card.tsx @@ -0,0 +1,25 @@ +"use client"; + +import { Overlay, Center, Loader } from "@mantine/core"; + +export default function ComponentGlobal_CardLoadingOverlay({ + size, + variant, +}: { + size?: number; + variant?: any; +}) { + return ( + <> + +
+ +
+
+ + ); +} diff --git a/src/app_modules/job/component/card_view_status.tsx b/src/app_modules/job/component/card_view_status.tsx index 428062fc..26df44e1 100644 --- a/src/app_modules/job/component/card_view_status.tsx +++ b/src/app_modules/job/component/card_view_status.tsx @@ -8,6 +8,8 @@ import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_gl import { MODEL_JOB } from "../model/interface"; import { RouterJob } from "@/app/lib/router_hipmi/router_job"; import { IconChevronRight } from "@tabler/icons-react"; +import { useState } from "react"; +import ComponentGlobal_CardLoadingOverlay from "@/app_modules/component_global/loading_card"; export default function ComponentJob_CardViewStatus({ listData, @@ -17,6 +19,9 @@ export default function ComponentJob_CardViewStatus({ path?: any; }) { const router = useRouter(); + const [jobId, setJobId] = useState(""); + const [visible, setVisible] = useState(false); + if (_.isEmpty(listData)) return ( <> @@ -40,7 +45,11 @@ export default function ComponentJob_CardViewStatus({ "Path tidak ditemukan" ); } else { - router.push(path + e.id); + visible + ? "" + : (setJobId(e?.id), + setVisible(true), + router.push(path + e?.id)); } }} > @@ -49,12 +58,17 @@ export default function ComponentJob_CardViewStatus({
- {e.title} + {e?.title}
+ {visible && e?.id === jobId ? ( + + ) : ( + "" + )} ))} diff --git a/src/app_modules/job/detail/arsip/view.tsx b/src/app_modules/job/detail/arsip/view.tsx index 788342d3..b62c39b1 100644 --- a/src/app_modules/job/detail/arsip/view.tsx +++ b/src/app_modules/job/detail/arsip/view.tsx @@ -10,6 +10,7 @@ import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/ import { useAtom } from "jotai"; import { Job_funEditArsipById } from "../../fun/edit/fun_edit_arsip_by_id"; import { gs_job_status, gs_job_hot_menu } from "../../global_state"; +import { useState } from "react"; export default function Job_DetailArsip({ dataJob }: { dataJob: MODEL_JOB }) { return ( @@ -24,6 +25,7 @@ export default function Job_DetailArsip({ dataJob }: { dataJob: MODEL_JOB }) { function ButtonAction({ jobId }: { jobId: string }) { const router = useRouter(); + const [isLoading, setLoading] = useState(false); const [status, setStatus] = useAtom(gs_job_status); const [hotMenu, setHotMenu] = useAtom(gs_job_hot_menu); @@ -33,6 +35,7 @@ function ButtonAction({ jobId }: { jobId: string }) { setStatus("Publish"); setHotMenu(1); ComponentGlobal_NotifikasiBerhasil("Berhasil Diarsipkan"); + setLoading(true); router.replace(RouterJob.beranda); } else { ComponentGlobal_NotifikasiGagal(res.message); @@ -42,6 +45,8 @@ function ButtonAction({ jobId }: { jobId: string }) { return ( <>