All day event package

This commit is contained in:
Milan Paunovic
2024-11-01 22:02:36 +01:00
parent 61fff87975
commit 87137e7b15
12 changed files with 322 additions and 146 deletions

View File

@ -20,6 +20,7 @@ export const useGetEvents = () => {
// If family view is active, include family, creator, and attendee events
if (isFamilyView) {
const familyQuery = db.collection("Events").where("familyID", "==", familyId);
const creatorQuery = db.collection("Events").where("creatorId", "==", userId);
const attendeeQuery = db.collection("Events").where("attendees", "array-contains", userId);
@ -83,7 +84,7 @@ export const useGetEvents = () => {
const eventColor = profileData?.eventColor || colorMap.pink;
return {
id: event.id || Math.random().toString(36).substr(2, 9), // Generate temp ID if missing
id: event.id || Math.random().toString(36).slice(2, 9), // Generate temp ID if missing
title: event.title,
start: new Date(event.startDate.seconds * 1000),
end: new Date(event.endDate.seconds * 1000),
@ -96,5 +97,6 @@ export const useGetEvents = () => {
},
staleTime: Infinity,
cacheTime: Infinity,
keepPreviousData: true,
});
};