From 3b15871ad4fa291ed17c09ad3ef9551d7281e464 Mon Sep 17 00:00:00 2001 From: bagasbanuna Date: Thu, 15 Jan 2026 13:54:14 +0800 Subject: [PATCH] Notifikasi join event Fix: modified: app/(application)/(user)/event/[id]/history.tsx modified: app/(application)/(user)/event/[id]/publish.tsx modified: app/(application)/(user)/event/create.tsx modified: app/(application)/(user)/notifications/index.tsx ### No Issue --- .../(user)/event/[id]/history.tsx | 2 +- .../(user)/event/[id]/publish.tsx | 26 ++++++++++++++----- app/(application)/(user)/event/create.tsx | 19 +------------- .../(user)/notifications/index.tsx | 2 +- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/app/(application)/(user)/event/[id]/history.tsx b/app/(application)/(user)/event/[id]/history.tsx index a96a189..30ad6b3 100644 --- a/app/(application)/(user)/event/[id]/history.tsx +++ b/app/(application)/(user)/event/[id]/history.tsx @@ -56,7 +56,7 @@ export default function EventDetailHistory() { setOpenDrawer(false)} - height={250} + height={"auto"} > (); const [isParticipant, setIsParticipant] = useState(null); useFocusEffect( @@ -108,7 +112,17 @@ export default function EventDetailPublish() { } }; - const footerButton = () => { + if ( + id && + data && + data?.tanggalSelesai && + dayjs(data?.tanggalSelesai).isBefore(now) + ) { + console.log("Event sudah selesai"); + return router.replace(`/event/${id}/history`); + } + + const FooterButton = () => { return ( <> , + headerLeft: () => router.back()} />, headerRight: () => setOpenDrawer(true)} />, }} /> {isLoadingData ? ( - + ) : ( )} diff --git a/app/(application)/(user)/event/create.tsx b/app/(application)/(user)/event/create.tsx index 3c98340..aa746a0 100644 --- a/app/(application)/(user)/event/create.tsx +++ b/app/(application)/(user)/event/create.tsx @@ -78,23 +78,6 @@ export default function EventCreate() { return; } - // if (selectedDate) { - // console.log("Tanggal yang dipilih:", selectedDate); - // console.log(`ISO Format ${Platform.OS}:`, selectedDate.toString()); - - // // Kirim ke API atau proses lanjutan - // } else { - // console.log("Tanggal belum dipilih"); - // } - - // if (selectedEndDate) { - // console.log("Tanggal yang dipilih:", selectedEndDate); - // console.log(`ISO Format ${Platform.OS}:`, selectedEndDate.toString()); - // // Kirim ke API atau proses lanjutan - // } else { - // console.log("Tanggal berakhir belum dipilih"); - // } - try { setIsLoading(true); @@ -110,7 +93,7 @@ export default function EventCreate() { const response = await apiEventCreate(newData); console.log("Response", JSON.stringify(response, null, 2)); - router.replace("/event/status"); + router.replace("/event/status?status=review"); } catch (error) { console.log(error); } finally { diff --git a/app/(application)/(user)/notifications/index.tsx b/app/(application)/(user)/notifications/index.tsx index 37ff3ac..dbec998 100644 --- a/app/(application)/(user)/notifications/index.tsx +++ b/app/(application)/(user)/notifications/index.tsx @@ -78,7 +78,7 @@ const BoxNotification = ({ categoryApp: data.kategoriApp, }); - router.replace(newPath as any); + router.navigate(newPath as any); selectedCategory(activeCategory as string); if (!data.isRead) {