Refactors calendar architecture for month view
Prepares the calendar component for month view implementation by introducing a strategy pattern for view management, splitting configuration settings, and consolidating events into a core set. It also removes dead code and enforces type safety, improving overall code quality and maintainability. Addresses critical issues identified in the code review, laying the groundwork for efficient feature addition.
This commit is contained in:
parent
7d513600d8
commit
3ddc6352f2
17 changed files with 1347 additions and 428 deletions
33
src/types/EventTypes.ts
Normal file
33
src/types/EventTypes.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/**
|
||||
* Type definitions for calendar events
|
||||
*/
|
||||
|
||||
export interface AllDayEvent {
|
||||
id: string;
|
||||
title: string;
|
||||
start: Date | string;
|
||||
end: Date | string;
|
||||
allDay: true;
|
||||
color?: string;
|
||||
metadata?: {
|
||||
color?: string;
|
||||
category?: string;
|
||||
location?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface TimeEvent {
|
||||
id: string;
|
||||
title: string;
|
||||
start: Date | string;
|
||||
end: Date | string;
|
||||
allDay?: false;
|
||||
color?: string;
|
||||
metadata?: {
|
||||
color?: string;
|
||||
category?: string;
|
||||
location?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type CalendarEventData = AllDayEvent | TimeEvent;
|
||||
Loading…
Add table
Add a link
Reference in a new issue