Merge pull request #542 from R0m1k3/1.1

feat: Implement a mobile calendar page to display orders and deliveri…
This commit is contained in:
LogiFlow authored and GitHub committed 2025-12-10 14:59:03 +01:00
commit 98e8c3f855
1 file changed
+3 -20
+3 -20
View File
@@ -51,9 +51,6 @@ export default function MobileCalendarPage() {
// Debug log - doit apparaître dans la console // Debug log - doit apparaître dans la console
console.log('🗓️ MobileCalendarPage RENDER', { user: !!user, selectedStoreId, currentMonth: currentMonth.toISOString() }); console.log('🗓️ MobileCalendarPage RENDER', { user: !!user, selectedStoreId, currentMonth: currentMonth.toISOString() });
const monthStart = startOfMonth(currentMonth);
const monthEnd = endOfMonth(currentMonth);
// Fetch orders for current month // Fetch orders for current month
const { data: orders = [], isLoading: loadingOrders } = useQuery({ const { data: orders = [], isLoading: loadingOrders } = useQuery({
queryKey: ["/api/orders", selectedStoreId, format(currentMonth, 'yyyy-MM')], queryKey: ["/api/orders", selectedStoreId, format(currentMonth, 'yyyy-MM')],
@@ -83,7 +80,6 @@ export default function MobileCalendarPage() {
enabled: !!user, enabled: !!user,
}); });
// Fetch deliveries for current month // Fetch deliveries for current month
const { data: deliveries = [], isLoading: loadingDeliveries } = useQuery({ const { data: deliveries = [], isLoading: loadingDeliveries } = useQuery({
queryKey: ["/api/deliveries", selectedStoreId, format(currentMonth, 'yyyy-MM')], 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 // Get days for the calendar grid
const calendarStart = startOfWeek(monthStart, { locale: fr }); const calendarStart = startOfWeek(monthStart, { locale: fr });
const calendarEnd = endOfWeek(monthEnd, { locale: fr }); const calendarEnd = endOfWeek(monthEnd, { locale: fr });
@@ -333,22 +332,6 @@ export default function MobileCalendarPage() {
</div> </div>
)} )}
</div> </div>
<Badge
variant="secondary"
className="mt-1 text-xs"
>
{event.status}
</Badge>
)}
</div>
</div>
</CardContent >
</Card >
))
)
}
</div >
)}
</div> </div>
</MobileLayout> </MobileLayout>
); );