From 112c1d4672ace4f04c005843d590f713ebb8d295 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 9 Nov 2024 11:20:50 +0500 Subject: [PATCH] Add calendar event --- .../Schedule/ScheduleEventModal.tsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/Schedule/ScheduleEventModal.tsx b/src/components/Schedule/ScheduleEventModal.tsx index 221805fe8..f01d4cbc0 100644 --- a/src/components/Schedule/ScheduleEventModal.tsx +++ b/src/components/Schedule/ScheduleEventModal.tsx @@ -96,6 +96,12 @@ Visit the roadmap at https://roadmap.sh/${roadmapId} const handleDownloadICS = () => { setIsLoading(true); + const calendarTitle = selectedCalendar || 'ICS'; + + triggerScheduleEvent( + `${calendarTitle.charAt(0).toUpperCase()}${calendarTitle.slice(1)}`, + ); + const startDate = DateTime.now().minus({ minutes: DateTime.now().minute % 30, }); @@ -119,8 +125,19 @@ Visit the roadmap at https://roadmap.sh/${roadmapId} URL.revokeObjectURL(url); }; + const triggerScheduleEvent = function (type: string) { + window.fireEvent({ + category: 'ScheduleTimeClick', + action: `Schedule Learning Time`, + label: `Schedule Learning Time / ${type}`, + value: `Schedule Learning Time / ${type}`, + }); + }; + const handleGoogleCalendar = () => { setIsLoading(true); + triggerScheduleEvent('Google'); + const baseURL = 'https://calendar.google.com/calendar/render?action=TEMPLATE'; @@ -293,7 +310,7 @@ export function CalendarSteps(props: CalendarStepsProps) {
{steps.map((step, index) => (
-
+
{index + 1}
@@ -305,7 +322,7 @@ export function CalendarSteps(props: CalendarStepsProps) {