Tweak calendar colors and support transparency in import
This commit is contained in:
@@ -81,7 +81,7 @@ export default function AddEventModal(
|
|||||||
<label class='text-slate-300 block pb-1' for='event_calendar'>Calendar</label>
|
<label class='text-slate-300 block pb-1' for='event_calendar'>Calendar</label>
|
||||||
<section class='flex items-center justify-between'>
|
<section class='flex items-center justify-between'>
|
||||||
<select
|
<select
|
||||||
class='input-field mr-2'
|
class='input-field mr-2 !w-5/6'
|
||||||
name='event_calendar'
|
name='event_calendar'
|
||||||
id='event_calendar'
|
id='event_calendar'
|
||||||
value={newEvent.value?.calendar_id || ''}
|
value={newEvent.value?.calendar_id || ''}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default function ImportEventsModal(
|
|||||||
<label class='text-slate-300 block pb-1' for='event_calendar'>Calendar</label>
|
<label class='text-slate-300 block pb-1' for='event_calendar'>Calendar</label>
|
||||||
<section class='flex items-center justify-between'>
|
<section class='flex items-center justify-between'>
|
||||||
<select
|
<select
|
||||||
class='input-field mr-2'
|
class='input-field mr-2 !w-5/6'
|
||||||
name='event_calendar'
|
name='event_calendar'
|
||||||
id='event_calendar'
|
id='event_calendar'
|
||||||
value={newCalendarId.value || ''}
|
value={newCalendarId.value || ''}
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ export default function Calendars({ initialCalendars }: CalendarsProps) {
|
|||||||
<label class='text-slate-300 block pb-1' for='calendar_color'>Color</label>
|
<label class='text-slate-300 block pb-1' for='calendar_color'>Color</label>
|
||||||
<section class='flex items-center justify-between'>
|
<section class='flex items-center justify-between'>
|
||||||
<select
|
<select
|
||||||
class='input-field mr-2'
|
class='input-field mr-2 !w-5/6'
|
||||||
name='calendar_color'
|
name='calendar_color'
|
||||||
id='calendar_color'
|
id='calendar_color'
|
||||||
value={openCalendar.value?.color || ''}
|
value={openCalendar.value?.color || ''}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export function parseVCalendarFromTextContents(text: string): Partial<CalendarEv
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.startsWith('DTSTART')) {
|
if (line.startsWith('DTSTART:') || line.startsWith('DTSTART;')) {
|
||||||
const startDateInfo = line.split(':')[1] || '';
|
const startDateInfo = line.split(':')[1] || '';
|
||||||
const [dateInfo, hourInfo] = startDateInfo.split('T');
|
const [dateInfo, hourInfo] = startDateInfo.split('T');
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ export function parseVCalendarFromTextContents(text: string): Partial<CalendarEv
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.startsWith('DTEND')) {
|
if (line.startsWith('DTEND:') || line.startsWith('DTEND;')) {
|
||||||
const endDateInfo = line.split(':')[1] || '';
|
const endDateInfo = line.split(':')[1] || '';
|
||||||
const [dateInfo, hourInfo] = endDateInfo.split('T');
|
const [dateInfo, hourInfo] = endDateInfo.split('T');
|
||||||
|
|
||||||
@@ -182,6 +182,31 @@ export function parseVCalendarFromTextContents(text: string): Partial<CalendarEv
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (line.startsWith('ORGANIZER;')) {
|
||||||
|
const organizerInfo = line.split(':');
|
||||||
|
const organizerEmail = organizerInfo.slice(-1)[0] || '';
|
||||||
|
|
||||||
|
if (!organizerEmail) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
partialCalendarEvent.extra = {
|
||||||
|
...(partialCalendarEvent.extra! || {}),
|
||||||
|
organizer_email: organizerEmail,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line.startsWith('TRANSP:')) {
|
||||||
|
const transparency = (line.split('TRANSP:')[1] as CalendarEvent['extra']['transparency']) || 'default';
|
||||||
|
|
||||||
|
partialCalendarEvent.extra = {
|
||||||
|
...(partialCalendarEvent.extra! || {}),
|
||||||
|
transparency,
|
||||||
|
};
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return partialCalendarEvents;
|
return partialCalendarEvents;
|
||||||
|
|||||||
@@ -19,27 +19,27 @@ form {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
@apply inline-block rounded text-white bg-[#51A4FB] hover:bg-sky-400 hover:shadow-sm px-4 py-2 !important;
|
@apply inline-block rounded text-white bg-[#51A4FB] hover:bg-sky-400 hover:shadow-sm px-4 py-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-secondary {
|
.button-secondary {
|
||||||
@apply inline-block rounded text-white bg-slate-600 hover:text-slate-900 hover:bg-slate-400 hover:shadow-sm px-4 py-2 !important;
|
@apply inline-block rounded text-white bg-slate-600 hover:text-slate-900 hover:bg-slate-400 hover:shadow-sm px-4 py-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-danger {
|
.button-danger {
|
||||||
@apply inline-block rounded text-slate-50 bg-red-600 hover:text-slate-900 hover:bg-red-400 hover:shadow-md px-4 py-2 !important;
|
@apply inline-block rounded text-slate-50 bg-red-600 hover:text-slate-900 hover:bg-red-400 hover:shadow-md px-4 py-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-field {
|
.input-field {
|
||||||
@apply block w-full p-2 rounded-md text-white bg-slate-700 border-transparent border focus:border-[#51A4FB] focus:bg-slate-700 outline-none focus:ring-0 shadow-sm !important;
|
@apply block w-full p-2 rounded-md text-white bg-slate-700 border-transparent border focus:border-[#51A4FB] focus:bg-slate-700 outline-none focus:ring-0 shadow-sm;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-field[type="range"] {
|
.input-field[type="range"] {
|
||||||
@apply w-auto !important;
|
@apply w-auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-field:required:invalid:not(:placeholder-shown) {
|
.input-field:required:invalid:not(:placeholder-shown) {
|
||||||
@apply bg-red-400 !important;
|
@apply bg-red-400;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notification-error {
|
.notification-error {
|
||||||
|
|||||||
Reference in New Issue
Block a user