mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
feat: Implement a mobile calendar page to display orders and deliveries as events.
This commit is contained in:
1 parent
d64ed9bbcd
commit
6f94d96420
1 file changed
+6
-23
@@ -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 });
|
||||||
@@ -280,8 +279,8 @@ export default function MobileCalendarPage() {
|
|||||||
<CardContent className="p-3">
|
<CardContent className="p-3">
|
||||||
<div className="flex items-start gap-3">
|
<div className="flex items-start gap-3">
|
||||||
<div className={`p-2 rounded-lg ${event.type === 'order'
|
<div className={`p-2 rounded-lg ${event.type === 'order'
|
||||||
? 'bg-blue-100'
|
? 'bg-blue-100'
|
||||||
: 'bg-green-100'
|
: 'bg-green-100'
|
||||||
}`}>
|
}`}>
|
||||||
{event.type === 'order'
|
{event.type === 'order'
|
||||||
? <Package className="h-4 w-4 text-blue-600" />
|
? <Package className="h-4 w-4 text-blue-600" />
|
||||||
@@ -333,23 +332,7 @@ export default function MobileCalendarPage() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Badge
|
|
||||||
variant="secondary"
|
|
||||||
className="mt-1 text-xs"
|
|
||||||
>
|
|
||||||
{event.status}
|
|
||||||
</Badge>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</MobileLayout>
|
||||||
</CardContent >
|
|
||||||
</Card >
|
|
||||||
))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</div >
|
|
||||||
)}
|
|
||||||
</div >
|
|
||||||
</MobileLayout >
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user