Merged in feature/IO-3352-Arrived-Color-on-Schedule (pull request #2532)
IO-3352 Arrived Color on Schedule Approved-by: Dave Richer
This commit is contained in:
@@ -40,27 +40,26 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
const currentView = search.view || defaultView || "week";
|
const currentView = search.view || defaultView || "week";
|
||||||
|
|
||||||
const handleEventPropStyles = (event) => {
|
const handleEventPropStyles = (event) => {
|
||||||
const hasColor = Boolean(event?.color?.hex || event?.color);
|
const { color, block, arrived } = event ?? {};
|
||||||
|
const hasColor = Boolean(color?.hex || color);
|
||||||
const useBg = currentView !== "agenda";
|
const useBg = currentView !== "agenda";
|
||||||
|
|
||||||
// Prioritize explicit blocked-day background to ensure red in all themes
|
// Prioritize explicit blocked-day background to ensure red in all themes
|
||||||
let bg;
|
let bg;
|
||||||
if (useBg) {
|
if (useBg) {
|
||||||
if (event?.block) {
|
bg = block
|
||||||
bg = "var(--event-block-bg)";
|
? "var(--event-block-bg)"
|
||||||
} else if (hasColor) {
|
: arrived
|
||||||
bg = event?.color?.hex ?? event?.color;
|
? "var(--event-arrived-bg)"
|
||||||
} else {
|
: (color?.hex ?? color ?? "var(--event-bg-fallback)");
|
||||||
bg = "var(--event-bg-fallback)";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const usedFallback = !hasColor && !event?.block; // only mark as fallback when not blocked
|
const usedFallback = !hasColor && !block && !arrived; // only mark as fallback when not blocked or arrived
|
||||||
|
|
||||||
const classes = [
|
const classes = [
|
||||||
"imex-event",
|
"imex-event",
|
||||||
event.arrived && "imex-event-arrived",
|
arrived && "imex-event-arrived",
|
||||||
event.block && "imex-event-block",
|
block && "imex-event-block",
|
||||||
usedFallback && "imex-event-fallback"
|
usedFallback && "imex-event-fallback"
|
||||||
]
|
]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
|
|||||||
Reference in New Issue
Block a user