diff --git a/app/app.vue b/app/app.vue index 60f0d50..725796c 100644 --- a/app/app.vue +++ b/app/app.vue @@ -1,12 +1,12 @@ diff --git a/app/components/AppButton.vue b/app/components/AppButton.vue new file mode 100644 index 0000000..8f76b05 --- /dev/null +++ b/app/components/AppButton.vue @@ -0,0 +1,68 @@ + + + diff --git a/app/components/AppCard.vue b/app/components/AppCard.vue new file mode 100644 index 0000000..9ba80bc --- /dev/null +++ b/app/components/AppCard.vue @@ -0,0 +1,28 @@ + + + diff --git a/app/components/CopyableCode.vue b/app/components/CopyableCode.vue new file mode 100644 index 0000000..c749ba9 --- /dev/null +++ b/app/components/CopyableCode.vue @@ -0,0 +1,58 @@ + + + diff --git a/app/components/DarkModeToggle.vue b/app/components/DarkModeToggle.vue new file mode 100644 index 0000000..eb51979 --- /dev/null +++ b/app/components/DarkModeToggle.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/components/DiscalLogo.vue b/app/components/DiscalLogo.vue new file mode 100644 index 0000000..645efc5 --- /dev/null +++ b/app/components/DiscalLogo.vue @@ -0,0 +1,462 @@ + + + diff --git a/app/components/EmptyState.vue b/app/components/EmptyState.vue new file mode 100644 index 0000000..ef776e1 --- /dev/null +++ b/app/components/EmptyState.vue @@ -0,0 +1,34 @@ + + + diff --git a/app/components/SkeletonLoader.vue b/app/components/SkeletonLoader.vue new file mode 100644 index 0000000..e1899cd --- /dev/null +++ b/app/components/SkeletonLoader.vue @@ -0,0 +1,45 @@ + + + diff --git a/app/components/StyledDialog.vue b/app/components/StyledDialog.vue new file mode 100644 index 0000000..1f4eaf0 --- /dev/null +++ b/app/components/StyledDialog.vue @@ -0,0 +1,65 @@ + + + diff --git a/app/pages/calendar/[slug].vue b/app/pages/calendar/[slug].vue index 9400c5b..b7385c6 100644 --- a/app/pages/calendar/[slug].vue +++ b/app/pages/calendar/[slug].vue @@ -26,61 +26,114 @@ useSeoMeta({ diff --git a/app/pages/dashboard/[guildId].vue b/app/pages/dashboard/[guildId].vue index 44956fb..24d7941 100644 --- a/app/pages/dashboard/[guildId].vue +++ b/app/pages/dashboard/[guildId].vue @@ -1,15 +1,4 @@ diff --git a/app/pages/dashboard/index.vue b/app/pages/dashboard/index.vue index 32d80bc..8340d87 100644 --- a/app/pages/dashboard/index.vue +++ b/app/pages/dashboard/index.vue @@ -2,10 +2,21 @@ const { loggedIn } = useUserSession() const config = useRuntimeConfig() -const { data: guilds, status: guildsStatus, error } = useLazyFetch('/api/guilds') -const { data: available, status: availableStatus } = useLazyFetch('/api/guilds/available') +const { data: guilds, status: guildsStatus, error, refresh: refreshGuilds } = useLazyFetch('/api/guilds', { + getCachedData: (key, nuxtApp) => nuxtApp.payload.data[key] ?? nuxtApp.static.data[key], +}) +const { data: available, status: availableStatus, refresh: refreshAvailable } = useLazyFetch('/api/guilds/available', { + getCachedData: (key, nuxtApp) => nuxtApp.payload.data[key] ?? nuxtApp.static.data[key], +}) const loading = computed(() => guildsStatus.value === 'pending' || availableStatus.value === 'pending') +const refreshing = ref(false) + +async function refreshAll() { + refreshing.value = true + await Promise.all([refreshGuilds(), refreshAvailable()]) + refreshing.value = false +} const botInviteUrl = computed(() => { const clientId = config.public.discordClientId @@ -33,7 +44,6 @@ async function registerGuild(guildId: string, guildName: string) { method: 'POST', body: { guildId, guildName }, }) - // Navigate to the new guild's dashboard immediately await navigateTo(`/dashboard/${result.id}`) } catch (err) { @@ -44,70 +54,171 @@ async function registerGuild(guildId: string, guildName: string) {