diff --git a/client/src/components/Planner/ReservationsPanel.tsx b/client/src/components/Planner/ReservationsPanel.tsx index 0c3402ac..399409b1 100644 --- a/client/src/components/Planner/ReservationsPanel.tsx +++ b/client/src/components/Planner/ReservationsPanel.tsx @@ -94,9 +94,10 @@ function ReservationCard({ r, tripId, onEdit, onDelete, files = [], onNavigateTo try { await onDelete(r.id) } catch { toast.error(t('reservations.toast.deleteError')) } } + const isMobile = typeof window !== 'undefined' && window.innerWidth < 768 const fmtDate = (str) => { const dateOnly = str.includes('T') ? str.split('T')[0] : str - return new Date(dateOnly + 'T00:00:00Z').toLocaleDateString(locale, { weekday: 'short', day: 'numeric', month: 'short', timeZone: 'UTC' }) + return new Date(dateOnly + 'T00:00:00Z').toLocaleDateString(locale, { ...(isMobile ? {} : { weekday: 'short' }), day: 'numeric', month: 'short', timeZone: 'UTC' }) } const fmtTime = (str) => { const d = new Date(str) @@ -174,20 +175,18 @@ function ReservationCard({ r, tripId, onEdit, onDelete, files = [], onNavigateTo {/* Body */}
- {/* Date / Time / Code row */} - {(hasDate || hasCode) && ( -
1 ? `repeat(${dateCols}, 1fr)` : '1fr' }}> - {hasDate && ( -
-
{t('reservations.date')}
-
- {fmtDate(r.reservation_time)} - {r.reservation_end_time && (r.reservation_end_time.includes('T') ? r.reservation_end_time.split('T')[0] : r.reservation_end_time) !== r.reservation_time.split('T')[0] && ( - <> – {fmtDate(r.reservation_end_time)} - )} -
+ {/* Date / Time row */} + {hasDate && ( +
+
+
{t('reservations.date')}
+
+ {fmtDate(r.reservation_time)} + {r.reservation_end_time && (r.reservation_end_time.includes('T') ? r.reservation_end_time.split('T')[0] : r.reservation_end_time) !== r.reservation_time.split('T')[0] && ( + <> – {fmtDate(r.reservation_end_time)} + )}
- )} +
{hasTime && (
{t('reservations.time')}
@@ -196,25 +195,26 @@ function ReservationCard({ r, tripId, onEdit, onDelete, files = [], onNavigateTo
)} - {hasCode && ( -
-
{t('reservations.confirmationCode')}
-
blurCodes && setCodeRevealed(true)} - onMouseLeave={() => blurCodes && setCodeRevealed(false)} - onClick={() => blurCodes && setCodeRevealed(v => !v)} - style={{ - ...fieldValueStyle, textAlign: 'center', - fontFamily: '"SF Mono", "JetBrains Mono", Menlo, monospace', fontSize: 12.5, - filter: blurCodes && !codeRevealed ? 'blur(5px)' : 'none', - cursor: blurCodes ? 'pointer' : 'default', - transition: 'filter 0.2s', - }} - > - {r.confirmation_number} -
-
- )} +
+ )} + {/* Booking code */} + {hasCode && ( +
+
{t('reservations.confirmationCode')}
+
blurCodes && setCodeRevealed(true)} + onMouseLeave={() => blurCodes && setCodeRevealed(false)} + onClick={() => blurCodes && setCodeRevealed(v => !v)} + style={{ + ...fieldValueStyle, textAlign: 'center', + fontFamily: '"SF Mono", "JetBrains Mono", Menlo, monospace', fontSize: 12.5, + filter: blurCodes && !codeRevealed ? 'blur(5px)' : 'none', + cursor: blurCodes ? 'pointer' : 'default', + transition: 'filter 0.2s', + }} + > + {r.confirmation_number} +
)} @@ -435,7 +435,7 @@ export default function ReservationsPanel({ tripId, reservations, days, assignme return (
{/* Unified toolbar */} -
+
0 && ( <> -
-
+
+
{/* Content */} -
+
{total === 0 && reservations.length === 0 ? (