feature/IO-3255-simplified-parts-management - Beef Up Change Request Parser, add Change Request documentation data
This commit is contained in:
@@ -37,17 +37,39 @@ export function ScheduleCalendarWrapperComponent({
|
||||
const history = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
|
||||
// Determine current view to compute styles consistently
|
||||
const currentView = search.view || defaultView || "week";
|
||||
|
||||
const handleEventPropStyles = (event, start, end, isSelected) => {
|
||||
const hasColor = Boolean(event?.color?.hex || event?.color);
|
||||
const useBg = currentView !== "agenda";
|
||||
|
||||
// Prioritize explicit blocked-day background to ensure red in all themes
|
||||
let bg;
|
||||
if (useBg) {
|
||||
if (event?.block) {
|
||||
bg = "var(--event-block-bg)";
|
||||
} else if (hasColor) {
|
||||
bg = event?.color?.hex ?? event?.color;
|
||||
} else {
|
||||
bg = "var(--event-bg-fallback)";
|
||||
}
|
||||
}
|
||||
|
||||
const usedFallback = !hasColor && !event?.block; // only mark as fallback when not blocked
|
||||
|
||||
const classes = [
|
||||
"imex-event",
|
||||
event.arrived && "imex-event-arrived",
|
||||
event.block && "imex-event-block",
|
||||
usedFallback && "imex-event-fallback"
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" ");
|
||||
|
||||
return {
|
||||
...(event.color && !((search.view || defaultView) === "agenda")
|
||||
? {
|
||||
style: {
|
||||
backgroundColor:
|
||||
event.color && event.color.hex ? event.color.hex : event.color || "var(--event-bg-fallback)"
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
className: `${event.arrived ? "imex-event-arrived" : ""} ${event.block ? "imex-event-block" : ""}`
|
||||
...(bg ? { style: { backgroundColor: bg } } : {}),
|
||||
className: classes
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user