From ae2a0bf3a1bed08a190e9e913a2919c15fe5f72e Mon Sep 17 00:00:00 2001 From: dwindown Date: Fri, 26 Dec 2025 00:53:54 +0700 Subject: [PATCH] Fix bootcamp and webinar action buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bootcamp fixes: - Change "Sudah Selesai" to "Selesai" (shorter, cleaner) - Replace "Selanjutnya" button with "Beri Ulasan" when all lessons completed - Makes more sense than "Lanjutkan" when there's nothing to continue Webinar fixes: - Check if webinar has ended based on event_start date - Only show "Gabung Webinar" button if webinar hasn't ended AND has meeting link - Show "Rekaman segera tersedia" badge for passed webinars without recording - Only show recording player/video if recording_url exists 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/pages/Bootcamp.tsx | 27 +++++++++++++++++---------- src/pages/ProductDetail.tsx | 30 ++++++++++++++++++++++-------- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/pages/Bootcamp.tsx b/src/pages/Bootcamp.tsx index 02ee94d..d8d1d34 100644 --- a/src/pages/Bootcamp.tsx +++ b/src/pages/Bootcamp.tsx @@ -408,22 +408,29 @@ export default function Bootcamp() { {isLessonCompleted(selectedLesson.id) ? ( <> - Sudah Selesai + Selesai ) : ( 'Tandai Selesai' )} - + {isBootcampCompleted ? ( + + ) : ( + + )} {/* Bootcamp completion review prompt */} diff --git a/src/pages/ProductDetail.tsx b/src/pages/ProductDetail.tsx index c8fa715..89b81bd 100644 --- a/src/pages/ProductDetail.tsx +++ b/src/pages/ProductDetail.tsx @@ -254,6 +254,9 @@ export default function ProductDetail() { ); case 'webinar': + // Check if webinar has ended + const webinarEnded = product.event_start && new Date(product.event_start) <= new Date(); + if (product.recording_url) { return (
@@ -274,14 +277,25 @@ export default function ProductDetail() {
); } - return product.meeting_link ? ( - - ) : Rekaman segera tersedia; + + // Only show "Gabung Webinar" if webinar hasn't ended and has meeting link + if (!webinarEnded && product.meeting_link) { + return ( + + ); + } + + // Webinar has ended but no recording yet + if (webinarEnded) { + return Rekaman segera tersedia; + } + + return null; case 'bootcamp': return (