diff --git a/netlify/functions/webcal.ts b/netlify/functions/webcal.ts index 6a878df..ba3d74a 100644 --- a/netlify/functions/webcal.ts +++ b/netlify/functions/webcal.ts @@ -46,12 +46,12 @@ export const handler: Handler = async (event) => { const PLAYER_ROLE = "player"; function sessionToIcal({ session, userId, role }) { - let title = `RUNNING - ${session.game_id.title}`; + let title = `${session.game_id.title} (Game Facilitator)`; if (role === PLAYER_ROLE) { title = session.rsvps.indexOf(userId) < session.participant_count - ? `CONFIRMED - ${session.game_id.title}` - : `WAITLIST - ${session.game_id.title}`; + ? `${session.game_id.title} (Confirmed Player)` + : `${session.game_id.title} (Waitlisted Player)`; } return { uid: `${session.id}#${userId}@playabl`, diff --git a/src/api/profiles.ts b/src/api/profiles.ts index f75b7d5..8d50765 100644 --- a/src/api/profiles.ts +++ b/src/api/profiles.ts @@ -48,6 +48,17 @@ export async function createWebCalForUser(userId: string) { if (data) return data; } +export async function deleteWebCalForUser(webcalId: string) { + const { error } = await supabase + .from("user_calendars") + .delete() + .eq("webcal_id", webcalId); + if (error) { + log(error); + throw error; + } +} + export async function loadWebCalForUser(userId: string) { const { data, error } = await supabase .from("user_calendars") diff --git a/src/components/Buttons/SecondaryButton.vue b/src/components/Buttons/SecondaryButton.vue index ab04f91..696b25b 100644 --- a/src/components/Buttons/SecondaryButton.vue +++ b/src/components/Buttons/SecondaryButton.vue @@ -26,6 +26,8 @@ const props = defineProps({ }); const colorClasses = computed(() => { switch (props.color) { + case "green": + return "bg-green-200 hover:bg-green-300 text-green-900"; case "blue": return "bg-blue-100 hover:bg-blue-200 text-blue-700"; case "gray": diff --git a/src/pages/Profile/SettingsPage.vue b/src/pages/Profile/SettingsPage.vue index dabb6a0..b853e48 100644 --- a/src/pages/Profile/SettingsPage.vue +++ b/src/pages/Profile/SettingsPage.vue @@ -13,7 +13,7 @@
Email settings
- +

We will always email when you join or are seated in a game. You can control when some other emails are sent below. @@ -46,12 +46,14 @@

User preferences
- Time of Day -

- You can set a start and end time to help identify sessions and games - that occur during your preferred times. You can also set this from - the games browse page. -

+ + Time of Day +

+ You can set a start and end time to help identify sessions and + games that occur during your preferred times. You can also set + this from the games browse page. +

+
@@ -63,6 +65,17 @@
+
-
+
Web calendar - +

Create a web calendar link that you can use with other programs to subscribe to your RSVPs and managed games. + This link is unique to you and should be kept private. +

+

+ Your calendar items will say if you are the + Game Facilitator, a + Confirmed Player, or a + Waitlisted Player. Because + calendar applications only sync periodically, always double-check + your RSVP status when waitlisted. You will continue to receive + emails when promoted from the waitlist.

-

- {{ - `webcal://app.playabl.io/.netlify/functions/webcal?id=${store.userWebCalId}` - }} -

+
+

+ {{ webcalLink }} +

+
+ + + Copied! + Copy web calendar link + + + + + Delete web calendar link (you can create a new one after) + +
+
- Create your web calendar + Create your web calendar link
@@ -99,20 +150,27 @@ diff --git a/src/util/flags.ts b/src/util/flags.ts index 88d5104..3a5ab10 100644 --- a/src/util/flags.ts +++ b/src/util/flags.ts @@ -1,7 +1,5 @@ const flags = { flags_ui: "flags_ui", - events: "events", - webcal: "webcal", }; export default flags;