This implements a basic CalDav UI, titled "Calendar". It allows creating new calendars and events with a start and end date, URL, location, and description. You can also import and export ICS (VCALENDAR + VEVENT) files. It allows editing the ICS directly, for power users. Additionally, you can hide/display events from certain calendars, change their names and their colors. If there's no calendar created yet in your CalDav server (first-time setup), it'll automatically create one, titled "Calendar". You can also change the display timezone for the calendar from the settings. Finally, there's some minor documentation fixes and some other minor tweaks. Closes #56 Closes #89
31 lines
1018 B
TypeScript
31 lines
1018 B
TypeScript
import { Calendar, CalendarEvent } from '/lib/models/calendar.ts';
|
|
import MainCalendar from '/components/calendar/MainCalendar.tsx';
|
|
|
|
interface CalendarWrapperProps {
|
|
initialCalendars: Calendar[];
|
|
initialCalendarEvents: CalendarEvent[];
|
|
view: 'day' | 'week' | 'month';
|
|
startDate: string;
|
|
baseUrl: string;
|
|
timezoneId: string;
|
|
timezoneUtcOffset: number;
|
|
}
|
|
|
|
// This wrapper is necessary because islands need to be the first frontend component, but they don't support functions as props, so the more complex logic needs to live in the component itself
|
|
export default function CalendarWrapper(
|
|
{ initialCalendars, initialCalendarEvents, view, startDate, baseUrl, timezoneId, timezoneUtcOffset }:
|
|
CalendarWrapperProps,
|
|
) {
|
|
return (
|
|
<MainCalendar
|
|
initialCalendars={initialCalendars}
|
|
initialCalendarEvents={initialCalendarEvents}
|
|
view={view}
|
|
startDate={startDate}
|
|
baseUrl={baseUrl}
|
|
timezoneId={timezoneId}
|
|
timezoneUtcOffset={timezoneUtcOffset}
|
|
/>
|
|
);
|
|
}
|