Fix calendar rental objects label: compact price, fixed row height
- Abbreviate price to ₽/д (fits in label width without wrapping) - Rental rows always use normal height (56px min) regardless of compact mode - Whitespace-nowrap on price line Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -496,20 +496,21 @@ export function BookingCalendar({ rooms, bookings, onBookingCreate, onBookingUpd
|
|||||||
{/* Rental object rows */}
|
{/* Rental object rows */}
|
||||||
{rentalObjects.map(obj => {
|
{rentalObjects.map(obj => {
|
||||||
const totalSpan = obj.closeHour - obj.openHour
|
const totalSpan = obj.closeHour - obj.openHour
|
||||||
|
const rentalRowH = Math.max(rowHeight, ROW_HEIGHT)
|
||||||
return (
|
return (
|
||||||
<div key={obj.id}
|
<div key={obj.id}
|
||||||
className="flex border-b border-slate-200 dark:border-slate-700"
|
className="flex border-b border-slate-200 dark:border-slate-700"
|
||||||
style={{ height: rowHeight }}>
|
style={{ height: rentalRowH }}>
|
||||||
{/* Label */}
|
{/* Label */}
|
||||||
<div
|
<div
|
||||||
className="shrink-0 sticky left-0 z-10 bg-white dark:bg-slate-800 border-r border-slate-200 dark:border-slate-700 flex items-center gap-2 px-3"
|
className="shrink-0 sticky left-0 z-10 bg-white dark:bg-slate-800 border-r border-slate-200 dark:border-slate-700 flex items-center gap-2 px-3"
|
||||||
style={{ width: LABEL_WIDTH }}
|
style={{ width: LABEL_WIDTH }}
|
||||||
>
|
>
|
||||||
<span className="text-lg">{obj.icon}</span>
|
<span className="text-base leading-none shrink-0">{obj.icon}</span>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<p className="text-sm font-medium text-slate-800 dark:text-slate-200 truncate">{obj.name}</p>
|
<p className="text-sm font-medium text-slate-800 dark:text-slate-200 truncate leading-tight">{obj.name}</p>
|
||||||
<p className="text-xs text-slate-400">
|
<p className="text-[10px] text-slate-400 whitespace-nowrap leading-tight mt-0.5">
|
||||||
{obj.pricePerHour.toLocaleString('ru-RU')} ₽/ч · {obj.pricePerDay.toLocaleString('ru-RU')} ₽/день
|
{obj.pricePerHour.toLocaleString('ru-RU')} ₽/ч · {obj.pricePerDay.toLocaleString('ru-RU')} ₽/д
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -534,7 +535,7 @@ export function BookingCalendar({ rooms, bookings, onBookingCreate, onBookingUpd
|
|||||||
isWe && 'bg-amber-50/30 dark:bg-amber-900/10',
|
isWe && 'bg-amber-50/30 dark:bg-amber-900/10',
|
||||||
isTod && 'bg-brand-50/40 dark:bg-brand-900/10',
|
isTod && 'bg-brand-50/40 dark:bg-brand-900/10',
|
||||||
)}
|
)}
|
||||||
style={{ width: CELL_WIDTH, height: rowHeight }}
|
style={{ width: CELL_WIDTH, height: rentalRowH }}
|
||||||
>
|
>
|
||||||
{hasFullDay ? (
|
{hasFullDay ? (
|
||||||
/* Full day booking */
|
/* Full day booking */
|
||||||
|
|||||||
Reference in New Issue
Block a user