feat: Implement a mobile calendar page to display orders and deliveries as events.

This commit is contained in:
Michael committed 2025-12-10 14:58:19 +01:00
1 parent d64ed9bbcd
commit 6f94d96420
1 file changed
+6 -23
+6 -23
View File
@@ -51,9 +51,6 @@ export default function MobileCalendarPage() {
// Debug log - doit apparaître dans la console
console.log('🗓️ MobileCalendarPage RENDER', { user: !!user, selectedStoreId, currentMonth: currentMonth.toISOString() });
const monthStart = startOfMonth(currentMonth);
const monthEnd = endOfMonth(currentMonth);
// Fetch orders for current month
const { data: orders = [], isLoading: loadingOrders } = useQuery({
queryKey: ["/api/orders", selectedStoreId, format(currentMonth, 'yyyy-MM')],
@@ -83,7 +80,6 @@ export default function MobileCalendarPage() {
enabled: !!user,
});
// Fetch deliveries for current month
const { data: deliveries = [], isLoading: loadingDeliveries } = useQuery({
queryKey: ["/api/deliveries", selectedStoreId, format(currentMonth, 'yyyy-MM')],
@@ -133,6 +129,9 @@ export default function MobileCalendarPage() {
}))
];
const monthStart = startOfMonth(currentMonth);
const monthEnd = endOfMonth(currentMonth);
// Get days for the calendar grid
const calendarStart = startOfWeek(monthStart, { locale: fr });
const calendarEnd = endOfWeek(monthEnd, { locale: fr });
@@ -280,8 +279,8 @@ export default function MobileCalendarPage() {
<CardContent className="p-3">
<div className="flex items-start gap-3">
<div className={`p-2 rounded-lg ${event.type === 'order'
? 'bg-blue-100'
: 'bg-green-100'
? 'bg-blue-100'
: 'bg-green-100'
}`}>
{event.type === 'order'
? <Package className="h-4 w-4 text-blue-600" />
@@ -333,23 +332,7 @@ export default function MobileCalendarPage() {
</div>
)}
</div>
<Badge
variant="secondary"
className="mt-1 text-xs"
>
{event.status}
</Badge>
)}
</div>
</div>
</CardContent >
</Card >
))
)
}
</div >
)}
</div >
</MobileLayout >
</MobileLayout>
);
}