- Fixed event coloring issue on the my view/family view

This commit is contained in:
Dejan
2024-11-21 23:53:18 +01:00
parent fb27079f10
commit 29ec985ffa
2 changed files with 4 additions and 2 deletions

View File

@ -104,7 +104,7 @@ export const EventCalendar: React.FC<EventCalendarProps> = React.memo(
const memoizedEventCellStyle = useCallback(
(event: CalendarEvent) => {
let eventColor = event.eventColor;
if (!isFamilyView && event.attendees?.includes(user?.uid)) {
if (!isFamilyView && (event.attendees?.includes(user?.uid) || event.creatorId === user?.uid)) {
eventColor = profileData?.eventColor ?? colorMap.teal;
}
@ -283,6 +283,7 @@ export const EventCalendar: React.FC<EventCalendarProps> = React.memo(
// enrichedEventsByDate={enrichedEvents}
events={filteredEvents}
eventCellStyle={memoizedEventCellStyle}
allDayEventCellStyle={memoizedEventCellStyle}
onPressEvent={handlePressEvent}
weekStartsOn={memoizedWeekStartsOn}
height={calendarHeight}

View File

@ -67,6 +67,7 @@ export const ManuallyAddEventModal = () => {
setDeleteModalVisible(false);
setSelectedNewEndDate(undefined);
setEditEvent(undefined);
setCreator(null)
},
initialDate: selectedNewEventDate || editEvent?.start,
};
@ -149,7 +150,7 @@ export const ManuallyAddEventModal = () => {
const fullName = `${creatorMember?.firstName ?? ""}`;
setCreator(fullName);
}
}, [])
}, [members])
const isLoading = isDeleting || isAdding;