pubs orange if overbooked

This commit is contained in:
Dobromir Popov
2024-06-28 19:57:59 +03:00
parent f8ae3d0072
commit 0d8d9bc4fd

View File

@ -785,7 +785,7 @@ export default function CalendarPage({ initialEvents, initialShifts }) {
<input type="checkbox" className="toggle-checkbox" id="filterIncludeOldAvailabilities" onChange={handleCheckboxChange} />
<span className="toggle-slider m-1">със стари предпочитания</span>
</label>
<ul className="w-full max-w-md">
<ul className="w-full max-w-md" id="availablePubsList" name="availablePubsList">
{Array.isArray(availablePubs) && availablePubs?.map((pub, index) => {
// Determine background and border classes based on conditions
let bgAndBorderColorClass;
@ -820,7 +820,7 @@ export default function CalendarPage({ initialEvents, initialShifts }) {
<li key={index}
className={`flex justify-between items-center p-4 sm:py-2 rounded-lg shadow-sm mb-2
${bgAndBorderColorClass} ${selectedBorderClass} ${activeOpacityClass}
${pub.currentMonthAssignments >= pub.desiredShiftsPerMonth ? 'text-gray-400' : 'text-gray-800'}`}
${pub.currentMonthAssignments === pub.desiredShiftsPerMonth ? 'text-gray-400' : pub.currentMonthAssignments > pub.desiredShiftsPerMonth ? 'text-orange-300' : 'text-gray-800'}`}
onDoubleClick={(handlePublisherModalOpen.bind(this, pub))}
onClick={handleSelectedPublisher.bind(this, pub)}
>