feat: add next event indicator to Show Page Calendar tab (#4348)
* feat: add next event indicator to Show Page Calendar tab Closes #4289 * feat: improve calendar animation * refactor: add some utils and fix sorting edge case with full day * refactor: rename CalendarCurrentEventIndicator to CalendarCurrentEventCursor * fix: fix tests * Fix lint --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
import { createContext } from 'react';
|
||||
|
||||
import { CalendarEvent } from '@/activities/calendar/types/CalendarEvent';
|
||||
|
||||
type CalendarContextValue = {
|
||||
calendarEventsByDayTime: Record<number, CalendarEvent[] | undefined>;
|
||||
currentCalendarEvent: CalendarEvent;
|
||||
getNextCalendarEvent: (
|
||||
calendarEvent: CalendarEvent,
|
||||
) => CalendarEvent | undefined;
|
||||
updateCurrentCalendarEvent: () => void;
|
||||
};
|
||||
|
||||
export const CalendarContext = createContext<CalendarContextValue>({
|
||||
calendarEventsByDayTime: {},
|
||||
currentCalendarEvent: {} as CalendarEvent,
|
||||
getNextCalendarEvent: () => undefined,
|
||||
updateCurrentCalendarEvent: () => {},
|
||||
});
|
||||
Reference in New Issue
Block a user