indicate loading daysBooked in calendar

This commit is contained in:
Thomas Ruoff
2020-09-14 23:05:14 +02:00
parent b5742f389e
commit c081640eaa
2 changed files with 8 additions and 2 deletions

View File

@@ -49,7 +49,10 @@ export default function MyCalendar() {
'Calendar-grid-item',
day.isSame(moment(), 'day') && 'Calendar-grid-item--current',
day.isBefore(moment(), 'day') && 'Calendar-grid-item--past',
dayBooked(day.toDate()) && 'Calendar-grid-item--booked',
!!daysBooked &&
(dayBooked(day.toDate())
? 'Calendar-grid-item--booked'
: 'Calendar-grid-item--free'),
classNames
)}
onClick={(e) => onPickDate(day)}

View File

@@ -124,7 +124,7 @@
}
.Calendar-grid-item {
@apply text-center p-1 bg-green-200 border-r border-b border-solid border-gray-500;
@apply text-center p-1 border-r border-b border-solid border-gray-500;
flex: 0 calc(100% / 7);
}
@@ -136,6 +136,9 @@
@apply font-bold;
}
.Calendar-grid-item--free:not(.Calendar-grid-item--past) {
@apply bg-green-200;
}
.Calendar-grid-item--booked {
@apply bg-red-200 cursor-not-allowed;
}