Require login for consulting booking and add availability banner on products page
- Consulting booking now requires authentication upfront (shows login prompt to non-users) - Added prominent consultation availability banner on products page when enabled - Added debug logging to Layout component for branding troubleshooting - Mobile Layout header shows responsive platform name sizing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -338,6 +338,26 @@ export default function ConsultingBooking() {
|
||||
);
|
||||
}
|
||||
|
||||
// Require authentication to access consulting booking
|
||||
if (!user) {
|
||||
return (
|
||||
<AppLayout>
|
||||
<div className="container mx-auto px-4 py-16 text-center">
|
||||
<div className="max-w-md mx-auto">
|
||||
<Video className="w-16 h-16 mx-auto mb-4 text-muted-foreground" />
|
||||
<h1 className="text-2xl font-bold mb-2">Login Diperlukan</h1>
|
||||
<p className="text-muted-foreground mb-6">
|
||||
Anda harus login untuk memesan jadwal konsultasi.
|
||||
</p>
|
||||
<Button onClick={() => navigate('/auth')} size="lg">
|
||||
Login Sekarang
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
|
||||
if (!settings?.is_consulting_enabled) {
|
||||
return (
|
||||
<AppLayout>
|
||||
|
||||
@@ -97,7 +97,29 @@ export default function Products() {
|
||||
<AppLayout>
|
||||
<div className="container mx-auto px-4 py-8">
|
||||
<h1 className="text-4xl font-bold mb-2">Produk</h1>
|
||||
<p className="text-muted-foreground mb-8">Jelajahi konsultasi, webinar, dan bootcamp kami</p>
|
||||
<p className="text-muted-foreground mb-4">Jelajahi konsultasi, webinar, dan bootcamp kami</p>
|
||||
|
||||
{/* Consulting Availability Banner */}
|
||||
{!loading && consultingSettings?.is_consulting_enabled && (
|
||||
<div className="mb-6 p-4 bg-primary/10 border-2 border-primary rounded-lg flex items-center justify-between">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="bg-primary text-primary-foreground p-2 rounded-full">
|
||||
<Video className="w-5 h-5" />
|
||||
</div>
|
||||
<div>
|
||||
<p className="font-semibold">Konsultasi Tersedia!</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Booking jadwal konsultasi 1-on-1 dengan mentor • {formatIDR(consultingSettings.consulting_block_price)} / {consultingSettings.consulting_block_duration_minutes} menit
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Link to="/consulting">
|
||||
<Button size="sm" className="shadow-sm">
|
||||
Booking
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{loading ? (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
|
||||
Reference in New Issue
Block a user