diff --git a/apps/builddao/widget/events/GoogleCalendarJoin.jsx b/apps/builddao/widget/events/GoogleCalendarJoin.jsx new file mode 100644 index 00000000..f807f21f --- /dev/null +++ b/apps/builddao/widget/events/GoogleCalendarJoin.jsx @@ -0,0 +1,22 @@ +const { Button } = VM.require("${config_account}/widget/components") || { + Button: () => <>, +}; + +const { data } = props; + +function parseDateForGoogleCalendar(date) { + return date ? new Date(date).toISOString().replace(/-|:|\.\d+/g, "") : ""; +} + +const googleEventLink = `https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(data.title)}&details=${encodeURIComponent(data.extendedProps.description ?? data.description)}&location=${encodeURIComponent(data?.url)}&dates=${encodeURIComponent(parseDateForGoogleCalendar(data.start))}/${encodeURIComponent(parseDateForGoogleCalendar(data.end))}`; + +return ( + +); diff --git a/apps/builddao/widget/events/ListView.jsx b/apps/builddao/widget/events/ListView.jsx index ad42a2fe..b3439e82 100644 --- a/apps/builddao/widget/events/ListView.jsx +++ b/apps/builddao/widget/events/ListView.jsx @@ -373,6 +373,13 @@ const EventGroup = ({ date }) => { > Join Now + {eventAuthor === context.accountId && ( + {eventAuthor === context.accountId && (