[#498] chip color helpers now returns 'accepted' style for private events without partstat (#531)

This commit is contained in:
Camille Moussu
2026-02-11 11:21:04 +01:00
committed by GitHub
parent bc4b05cc6a
commit d275d62f06
2 changed files with 20 additions and 4 deletions
+5 -2
View File
@@ -94,13 +94,16 @@ export function EventChip({
const titleStyle = getTitleStyle(
bestColor,
ownerAttendee?.partstat,
calendar
calendar,
isPrivate
);
const cardStyle = getCardStyle(
bestColor,
eventLength,
ownerAttendee?.partstat,
calendar
calendar,
isPrivate
);
// Organizer avatar
@@ -56,7 +56,8 @@ export function getOwnerAttendee(
export function getTitleStyle(
bestColor: string,
partstat?: string,
calendar?: Calendar
calendar?: Calendar,
isPrivate?: boolean
): React.CSSProperties {
const baseStyle: React.CSSProperties = {
fontFamily: "Roboto",
@@ -82,6 +83,9 @@ export function getTitleStyle(
case "NEEDS-ACTION":
return baseStyle;
default:
if (isPrivate) {
return { ...baseStyle, color: calendar?.color?.dark };
}
return baseStyle;
}
}
@@ -126,7 +130,8 @@ export function getCardStyle(
bestColor: string,
eventLength: number,
partstat?: string,
calendar?: Calendar
calendar?: Calendar,
isPrivate?: boolean
): React.CSSProperties {
const baseStyle: React.CSSProperties = getCardVariantStyle(
getEventVariant(eventLength),
@@ -156,6 +161,14 @@ export function getCardStyle(
border: "1px solid white",
};
default:
if (isPrivate) {
return {
...baseStyle,
backgroundColor: calendar?.color?.light,
color: calendar?.color?.dark,
border: "1px solid white",
};
}
return baseStyle;
}
}