1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-03-21 12:29:03 +01:00

(ui) mark canceled slots as this

This commit is contained in:
Sylvain 2023-01-20 17:05:38 +01:00
parent 28b64f3c6d
commit 63e8a1a4a6
3 changed files with 15 additions and 4 deletions

View File

@ -76,13 +76,13 @@ const ReservationsPanel: React.FC<SpaceReservationsProps> = ({ userId, onError,
*/
const renderReservation = (reservation: Reservation, state: 'past' | 'futur'): ReactNode => {
return (
<div key={reservation.id} className="reservations-list-item">
<div key={reservation.id} className={`reservations-list-item ${isCancelled(reservation) ? 'cancelled' : ''}`}>
<p className='name'>{reservation.reservable.name}</p>
<div className="date">
{reservation.slots_reservations_attributes.filter(s => filterSlot(s, state)).map(
slotReservation => <p key={slotReservation.id}>
{FormatLib.date(slotReservation.slot_attributes.start_at)} - {FormatLib.time(slotReservation.slot_attributes.start_at)} - {FormatLib.time(slotReservation.slot_attributes.end_at)}
slotReservation => <p key={slotReservation.id} className={slotReservation.canceled_at ? 'cancelled' : ''}>
{slotReservation.canceled_at ? t('app.logged.dashboard.reservations_dashboard.reservations_panel.cancelled_slot') : ''} {FormatLib.date(slotReservation.slot_attributes.start_at)} - {FormatLib.time(slotReservation.slot_attributes.start_at)} - {FormatLib.time(slotReservation.slot_attributes.end_at)}
</p>
)}
</div>

View File

@ -45,7 +45,17 @@
grid-column: 1 / -1;
border-bottom: 1px solid var(--gray-soft-dark);
}
.reservations-list-item { font-weight: 400; }
.reservations-list-item {
font-weight: 400;
&.cancelled {
color: var(--gray-soft-darkest);
}
.date p.cancelled {
color: var(--gray-soft-darkest);
}
}
}
.no-reservations {

View File

@ -153,6 +153,7 @@ en:
history: "History"
no_reservation: "No reservation"
show_more: "Show more"
cancelled_slot: "Cancelled"
credits_panel:
title: "My credits"
info: "Your subscription comes with free credits you can use on reservations"