Fix Tiptap editor visual formatting and improve badge contrast
Tiptap Editor Improvements: - Active toolbar buttons now use primary background (black) instead of accent (gray) for better visibility - Added visual formatting for headings (h1: 2xl bold, h2: xl bold with proper spacing) - Added visual styling for blockquotes (left border, italic, muted foreground) Badge Contrast Fixes: - Product detail page badges now use primary background (black with white text) instead of secondary/accent (gray) - Fixed product type badge and "Anda memiliki akses" badge - Fixed "Rekaman segera tersedia" badge API Query Fix: - Fixed consulting_slots 400 error by removing unsupported nested relationship filter - Changed to filter in JavaScript after fetching data from Supabase 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -267,7 +267,7 @@ export default function ProductDetail() {
|
||||
Gabung Webinar
|
||||
</a>
|
||||
</Button>
|
||||
) : <Badge className="bg-secondary">Rekaman segera tersedia</Badge>;
|
||||
) : <Badge className="bg-primary text-primary-foreground">Rekaman segera tersedia</Badge>;
|
||||
case 'bootcamp':
|
||||
return (
|
||||
<Button onClick={() => navigate(`/bootcamp/${product.slug}`)} size="lg" className="shadow-sm">
|
||||
@@ -346,8 +346,8 @@ export default function ProductDetail() {
|
||||
<div>
|
||||
<h1 className="text-4xl font-bold mb-2">{product.title}</h1>
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge className="bg-secondary capitalize">{product.type}</Badge>
|
||||
{hasAccess && <Badge className="bg-accent">Anda memiliki akses</Badge>}
|
||||
<Badge className="bg-primary text-primary-foreground capitalize">{product.type}</Badge>
|
||||
{hasAccess && <Badge className="bg-primary text-primary-foreground">Anda memiliki akses</Badge>}
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-right">
|
||||
|
||||
@@ -66,18 +66,24 @@ export default function MemberDashboard() {
|
||||
qr_expires_at
|
||||
)
|
||||
`)
|
||||
.eq('orders.payment_status', 'pending')
|
||||
.eq('status', 'pending_payment')
|
||||
.gt('orders.qr_expires_at', new Date().toISOString())
|
||||
.order('created_at', { ascending: false });
|
||||
|
||||
if (!error && data) {
|
||||
// Filter in JavaScript: only include slots where order is pending AND not expired
|
||||
const now = new Date().toISOString();
|
||||
const validSlots = data.filter((item: any) =>
|
||||
item.orders?.payment_status === 'pending' &&
|
||||
item.orders?.qr_expires_at &&
|
||||
item.orders.qr_expires_at > now
|
||||
);
|
||||
|
||||
// Get unique order IDs
|
||||
const uniqueOrders = Array.from(
|
||||
new Set(data.map((item: any) => item.order_id))
|
||||
new Set(validSlots.map((item: any) => item.order_id))
|
||||
).map((orderId) => {
|
||||
// Find the corresponding order data
|
||||
const orderData = data.find((item: any) => item.order_id === orderId);
|
||||
const orderData = validSlots.find((item: any) => item.order_id === orderId);
|
||||
return {
|
||||
order_id: orderId,
|
||||
qr_expires_at: (orderData as any)?.orders?.qr_expires_at || ''
|
||||
|
||||
Reference in New Issue
Block a user