From 4d1d43194ac3fe0add28732b2b86376d38e1009a Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 18 Aug 2025 14:18:20 +0000 Subject: [PATCH] Refine calendar item display and overflow handling for better visualization Adjust styling and reduce visible items in calendar overflow for improved readability and production readiness. Replit-Commit-Author: Agent Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cc2d271b-82f0-4d6a-9302-a0b067ffb429/lUEmTwP --- client/src/components/CalendarGrid.tsx | 59 ++++++++++++++------------ 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/client/src/components/CalendarGrid.tsx b/client/src/components/CalendarGrid.tsx index 27efdcd..62b7af0 100644 --- a/client/src/components/CalendarGrid.tsx +++ b/client/src/components/CalendarGrid.tsx @@ -38,22 +38,25 @@ function CalendarItem({ item, type, onItemClick }: { item: any, type: 'order' | return (
{ e.stopPropagation(); onItemClick(item, 'order'); }} + style={{marginBottom: '2px', display: 'block', width: '100%'}} > - - {item.supplier.name} - -
- {item.status === 'planned' && ( -
- )} - {item.status === 'delivered' && ( - - )} +
+ + {item.supplier?.name || 'Commande'} + +
+ {item.status === 'planned' && ( +
+ )} + {item.status === 'delivered' && ( + + )} +
); @@ -73,22 +76,25 @@ function CalendarItem({ item, type, onItemClick }: { item: any, type: 'order' | return (
{ e.stopPropagation(); onItemClick(item, 'delivery'); }} + style={{marginBottom: '2px', display: 'block', width: '100%'}} > - - {item.supplier.name} - {formatQuantity(item.quantity, item.unit)} - -
- {item.status === 'pending' && ( -
- )} - {item.status === 'delivered' && ( - - )} +
+ + {item.supplier?.name || 'Livraison'} - {formatQuantity(item.quantity, item.unit)} + +
+ {item.status === 'pending' && ( +
+ )} + {item.status === 'delivered' && ( + + )} +
); @@ -97,7 +103,7 @@ function CalendarItem({ item, type, onItemClick }: { item: any, type: 'order' | // Composant pour gérer l'overflow avec modal function DayItemsContainer({ dayOrders, dayDeliveries, onItemClick }: { dayOrders: any[], dayDeliveries: any[], onItemClick: (item: any, type: 'order' | 'delivery') => void }) { const [isOpen, setIsOpen] = useState(false); - const MAX_VISIBLE_ITEMS = 4; + const MAX_VISIBLE_ITEMS = 3; // Optimisé pour production const totalItems = dayOrders.length + dayDeliveries.length; if (totalItems === 0) return null; @@ -130,7 +136,8 @@ function DayItemsContainer({ dayOrders, dayDeliveries, onItemClick }: { dayOrder
- {/* Orders and Deliveries avec design moderne */} -
+ {/* Orders and Deliveries - Production optimisé */} +