Fix bootcamp and webinar action buttons
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 <noreply@anthropic.com>
This commit is contained in:
@@ -408,13 +408,19 @@ export default function Bootcamp() {
|
|||||||
{isLessonCompleted(selectedLesson.id) ? (
|
{isLessonCompleted(selectedLesson.id) ? (
|
||||||
<>
|
<>
|
||||||
<Check className="w-4 h-4 mr-2" />
|
<Check className="w-4 h-4 mr-2" />
|
||||||
Sudah Selesai
|
Selesai
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
'Tandai Selesai'
|
'Tandai Selesai'
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
{isBootcampCompleted ? (
|
||||||
|
<Button onClick={() => setReviewModalOpen(true)} className="shadow-sm">
|
||||||
|
<Star className="w-4 h-4 mr-2" />
|
||||||
|
Beri Ulasan
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={goToNextLesson}
|
onClick={goToNextLesson}
|
||||||
@@ -424,6 +430,7 @@ export default function Bootcamp() {
|
|||||||
Selanjutnya
|
Selanjutnya
|
||||||
<ChevronRight className="w-4 h-4 ml-2" />
|
<ChevronRight className="w-4 h-4 ml-2" />
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Bootcamp completion review prompt */}
|
{/* Bootcamp completion review prompt */}
|
||||||
|
|||||||
@@ -254,6 +254,9 @@ export default function ProductDetail() {
|
|||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
case 'webinar':
|
case 'webinar':
|
||||||
|
// Check if webinar has ended
|
||||||
|
const webinarEnded = product.event_start && new Date(product.event_start) <= new Date();
|
||||||
|
|
||||||
if (product.recording_url) {
|
if (product.recording_url) {
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
@@ -274,14 +277,25 @@ export default function ProductDetail() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return product.meeting_link ? (
|
|
||||||
|
// Only show "Gabung Webinar" if webinar hasn't ended and has meeting link
|
||||||
|
if (!webinarEnded && product.meeting_link) {
|
||||||
|
return (
|
||||||
<Button asChild size="lg" className="shadow-sm">
|
<Button asChild size="lg" className="shadow-sm">
|
||||||
<a href={product.meeting_link} target="_blank" rel="noopener noreferrer">
|
<a href={product.meeting_link} target="_blank" rel="noopener noreferrer">
|
||||||
<Video className="w-4 h-4 mr-2" />
|
<Video className="w-4 h-4 mr-2" />
|
||||||
Gabung Webinar
|
Gabung Webinar
|
||||||
</a>
|
</a>
|
||||||
</Button>
|
</Button>
|
||||||
) : <Badge className="bg-primary text-primary-foreground">Rekaman segera tersedia</Badge>;
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Webinar has ended but no recording yet
|
||||||
|
if (webinarEnded) {
|
||||||
|
return <Badge className="bg-muted text-primary">Rekaman segera tersedia</Badge>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
case 'bootcamp':
|
case 'bootcamp':
|
||||||
return (
|
return (
|
||||||
<Button onClick={() => navigate(`/bootcamp/${product.slug}`)} size="lg" className="shadow-sm">
|
<Button onClick={() => navigate(`/bootcamp/${product.slug}`)} size="lg" className="shadow-sm">
|
||||||
|
|||||||
Reference in New Issue
Block a user