diff --git a/src/routes/(console)/wizard/support/mobileSupportModal.svelte b/src/lib/components/mobileSupportModal.svelte similarity index 100% rename from src/routes/(console)/wizard/support/mobileSupportModal.svelte rename to src/lib/components/mobileSupportModal.svelte diff --git a/src/lib/components/support.svelte b/src/lib/components/support.svelte index 66d922d410..de29b9a0d3 100644 --- a/src/lib/components/support.svelte +++ b/src/lib/components/support.svelte @@ -1,18 +1,28 @@ + + + Support - Appwrite + + + + Support + + Please describe your request in detail, including reproduction steps of any in-app issues. + + +
+ + + {#if category === 'technical'} + + + ({ + ...option, + checked: product.includes(option.value) + }))} /> + + {/if} + {#if orgs?.total && category === 'billing'} + ({ + value: org.$id, + label: org.name + }))} /> + {/if} + + + +
+ + +

+ We will contact you at {$user.email}. We try to respond to all messages + within our office hours. +

+
    +
  • + Available: {supportWeekDays}, {supportTimings} + +
  • +
  • + Currently: + {#if isSupportOnline()} +
  • +
+ +
+ {#key $app.themeInUse} + + {/key} +
+
+
+
+ + + + + +
diff --git a/src/routes/(console)/support/+page.ts b/src/routes/(console)/support/+page.ts new file mode 100644 index 0000000000..6a9a9eeb66 --- /dev/null +++ b/src/routes/(console)/support/+page.ts @@ -0,0 +1,9 @@ +import { base } from '$app/paths'; +import { isCloud } from '$lib/system.js'; +import { redirect } from '@sveltejs/kit'; + +export const load = async () => { + if (!isCloud) { + redirect(303, base); + } +}; diff --git a/src/routes/(console)/support/store.ts b/src/routes/(console)/support/store.ts new file mode 100644 index 0000000000..473667cc64 --- /dev/null +++ b/src/routes/(console)/support/store.ts @@ -0,0 +1,15 @@ +export function isSupportOnline() { + const currentDate = new Date(); + const day = currentDate.getUTCDay(); + const hour = currentDate.getUTCHours(); + + if (day === 1 || day === 6) { + return false; + } + + if (hour < 14) { + return false; + } + + return true; +} diff --git a/src/routes/(console)/supportWizard.svelte b/src/routes/(console)/supportWizard.svelte deleted file mode 100644 index 615b43c9c2..0000000000 --- a/src/routes/(console)/supportWizard.svelte +++ /dev/null @@ -1,118 +0,0 @@ - - - - -

Contact the Appwrite Team

-

- If you found a bug or have questions, please reach out to the Appwrite team. We try to - respond to all messages within our office hours. -

-

- Available: {supportWeekDays}, {supportTimings} -

-
- Currently: - {#if isSupportOnline()} -
-
-
diff --git a/src/routes/(console)/wizard/support/step1.svelte b/src/routes/(console)/wizard/support/step1.svelte deleted file mode 100644 index 06f8f265b9..0000000000 --- a/src/routes/(console)/wizard/support/step1.svelte +++ /dev/null @@ -1,61 +0,0 @@ - - - - How can we help you? - - Please describe your request in detail. If applicable, include steps for reproduction of any - in-app issues. - -
-

Choose a topic

-
- {#each ['general', 'billing', 'technical'] as topic} - { - $supportData.category = topic; - }}>{topic} - {/each} -
-
-
- - {#if options?.length} - - {/if} - - -
-
diff --git a/src/routes/(console)/wizard/support/store.ts b/src/routes/(console)/wizard/support/store.ts deleted file mode 100644 index 368fbae244..0000000000 --- a/src/routes/(console)/wizard/support/store.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { writable } from 'svelte/store'; - -export type SupportData = { - message: string; - category: string; - file?: File | null; - project?: string; -}; - -export const supportData = writable({ - message: '', - category: 'general', - file: null -}); - -export function isSupportOnline() { - const currentDate = new Date(); - const day = currentDate.getUTCDay(); - const hour = currentDate.getUTCHours(); - - if (day === 1 || day === 6) { - return false; - } - - if (hour < 14) { - return false; - } - - return true; -} - -export const showSupportModal = writable(false);