Merge pull request #538 from R0m1k3/1.1

feat: add mobile pages for delivery and order listing with search and…
This commit is contained in:
LogiFlow authored and GitHub committed 2025-12-10 14:18:02 +01:00
commit 149371bf6c
3 files changed
+17 -13

No files matched your search

+7 -1
View File
@@ -75,7 +75,10 @@ export default function MobileDeliveriesPage() {
}); });
const getDateBadge = (dateStr: string) => { const getDateBadge = (dateStr: string) => {
if (!dateStr) return null;
const date = new Date(dateStr); const date = new Date(dateStr);
if (isNaN(date.getTime())) return null;
if (isToday(date)) { if (isToday(date)) {
return <Badge className="bg-blue-100 text-blue-700">Aujourd'hui</Badge>; return <Badge className="bg-blue-100 text-blue-700">Aujourd'hui</Badge>;
} }
@@ -179,7 +182,10 @@ export default function MobileDeliveriesPage() {
<p className="text-xs text-gray-500 flex items-center gap-1 mt-1"> <p className="text-xs text-gray-500 flex items-center gap-1 mt-1">
<Calendar className="h-3 w-3" /> <Calendar className="h-3 w-3" />
{format(new Date(delivery.expectedDate), 'dd/MM/yyyy', { locale: fr })} {delivery.expectedDate && !isNaN(new Date(delivery.expectedDate).getTime())
? format(new Date(delivery.expectedDate), 'dd/MM/yyyy', { locale: fr })
: 'Date inconnue'
}
</p> </p>
</div> </div>
+4 -1
View File
@@ -164,7 +164,10 @@ export default function MobileOrdersPage() {
<p className="text-xs text-gray-500 flex items-center gap-1 mt-1"> <p className="text-xs text-gray-500 flex items-center gap-1 mt-1">
<Calendar className="h-3 w-3" /> <Calendar className="h-3 w-3" />
{format(new Date(order.orderDate), 'dd/MM/yyyy', { locale: fr })} {order.orderDate && !isNaN(new Date(order.orderDate).getTime())
? format(new Date(order.orderDate), 'dd/MM/yyyy', { locale: fr })
: 'Date inconnue'
}
</p> </p>
</div> </div>
+6 -11
View File
@@ -361,23 +361,17 @@ export default function MobileTasksPage() {
// Loading // Loading
if (isLoading) { if (isLoading) {
return ( return (
<div className="flex items-center justify-center h-screen"> <MobileLayout>
<div className="flex items-center justify-center h-64">
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600" /> <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600" />
</div> </div>
</MobileLayout>
); );
} }
return ( return (
<div <MobileLayout>
className="min-h-screen bg-gray-50 pb-24" <div className="p-3 space-y-3">
style={{
width: '100%',
maxWidth: '100vw',
overflowX: 'hidden',
boxSizing: 'border-box'
}}
>
{/* Header */}
<div className="bg-white border-b sticky top-0 z-40" style={{ width: '100%', boxSizing: 'border-box' }}> <div className="bg-white border-b sticky top-0 z-40" style={{ width: '100%', boxSizing: 'border-box' }}>
<div className="px-3 py-3"> <div className="px-3 py-3">
<div className="flex items-center justify-between mb-3"> <div className="flex items-center justify-between mb-3">
@@ -488,5 +482,6 @@ export default function MobileTasksPage() {
</div> </div>
)} )}
</div> </div>
</MobileLayout>
); );
} }