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:
Thaïs
2024-03-12 10:27:51 -03:00
committed by GitHub
parent 0d8e700239
commit ab4ab1dfba
17 changed files with 668 additions and 110 deletions

View File

@ -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: () => {},
});