mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
new: support layout.
This commit is contained in:
1 parent
bc20be4210
commit
7ff085d087
3 files changed
+142
-101
No files matched your search
+136
-100
@@ -1,15 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { app } from '$lib/stores/app';
|
||||
import { wizard } from '$lib/stores/wizard';
|
||||
import SupportWizard from '$routes/(console)/supportWizard.svelte';
|
||||
import { showSupportModal } from '$routes/(console)/wizard/support/store';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { isSupportOnline, showSupportModal } from '$routes/(console)/wizard/support/store';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { localeTimezoneName, utcHourToLocaleHour } from '$lib/helpers/date';
|
||||
import { localeShortTimezoneName, utcHourToLocaleHour } from '$lib/helpers/date';
|
||||
import { upgradeURL } from '$lib/stores/billing';
|
||||
import { Card } from '$lib/components/index';
|
||||
import { app } from '$lib/stores/app';
|
||||
|
||||
export let show = false;
|
||||
|
||||
@@ -17,107 +17,143 @@
|
||||
$organization?.billingPlan === BillingPlan.PRO ||
|
||||
$organization?.billingPlan === BillingPlan.SCALE;
|
||||
|
||||
$: supportTimings = `${utcHourToLocaleHour('16:00')} - ${utcHourToLocaleHour('00:00')} ${localeTimezoneName()}`;
|
||||
$: supportTimings = `${utcHourToLocaleHour('16:00')} - ${utcHourToLocaleHour('00:00')} ${localeShortTimezoneName()}`;
|
||||
|
||||
type SupportOption = {
|
||||
cta?: string;
|
||||
icon: string;
|
||||
label: string;
|
||||
link?: string;
|
||||
description: string;
|
||||
showSupport: boolean;
|
||||
};
|
||||
|
||||
const supportOptions: SupportOption[] = [
|
||||
{
|
||||
showSupport: true,
|
||||
icon: 'support',
|
||||
label: 'Premium support',
|
||||
description: 'Get priority email support from the Appwrite team'
|
||||
},
|
||||
|
||||
{
|
||||
icon: 'discord',
|
||||
cta: 'Discord',
|
||||
showSupport: false,
|
||||
label: 'Community support',
|
||||
link: 'https://appwrite.io/discord',
|
||||
description: 'Get support from our community through Discord'
|
||||
},
|
||||
{
|
||||
icon: 'github',
|
||||
cta: 'Open issue',
|
||||
showSupport: false,
|
||||
label: 'Open GitHub issue',
|
||||
link: 'https://github.com/appwrite',
|
||||
description: 'Report a bug or pitch a new feature'
|
||||
}
|
||||
];
|
||||
</script>
|
||||
|
||||
{#if isCloud}
|
||||
<section class="drop-section u-grid u-gap-24 u-padding-24">
|
||||
<div>
|
||||
<h4 class="eyebrow-heading-3">Premium support</h4>
|
||||
{#if isPaid}
|
||||
<section class="drop-section support-section">
|
||||
<h4 class="heading-level-6">Support</h4>
|
||||
|
||||
{#each supportOptions as option}
|
||||
<Card
|
||||
isTile
|
||||
class="restore-modal-inner-card u-flex u-flex-vertical u-gap-12"
|
||||
style="border-radius: var(--border-radius-small, 8px); padding: 0.65rem;">
|
||||
<div class="u-flex u-flex-vertical u-gap-4">
|
||||
<h4 class="body-text-2 u-bold">{option.label}</h4>
|
||||
|
||||
<p class="u-line-height-1-5 u-margin-block-start-8">
|
||||
Get personalized support from the Appwrite team from <b>{supportTimings}</b>
|
||||
{option.description}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{#if option.showSupport}
|
||||
<div class="u-flex u-gap-12 u-cross-center">
|
||||
{#if !isPaid}
|
||||
<Button
|
||||
href={$upgradeURL}
|
||||
on:click={() => {
|
||||
trackEvent('click_organization_upgrade', {
|
||||
from: 'button',
|
||||
source: 'support_menu'
|
||||
});
|
||||
}}
|
||||
><span class="text">Get Premium support</span>
|
||||
</Button>
|
||||
{:else}
|
||||
<Button
|
||||
secondary
|
||||
on:click={() => {
|
||||
show = false;
|
||||
$showSupportModal = false;
|
||||
wizard.start(SupportWizard);
|
||||
}}>
|
||||
<span class="text">Contact support</span>
|
||||
</Button>
|
||||
{/if}
|
||||
|
||||
<div class="u-flex u-gap-4 u-cross-center">
|
||||
{#if isSupportOnline()}
|
||||
<span
|
||||
class="icon-check-circle u-color-text-success"
|
||||
aria-hidden="true" />
|
||||
{/if}
|
||||
|
||||
{supportTimings}
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<Button
|
||||
href={option.link}
|
||||
external
|
||||
secondary
|
||||
class="u-flex u-cross-center u-gap-6"
|
||||
on:click={() => {
|
||||
trackEvent('click_organization_upgrade', {
|
||||
from: 'button',
|
||||
source: 'support_menu'
|
||||
});
|
||||
}}>
|
||||
<span class={`icon-${option.icon}`} />
|
||||
<span>{option.cta}</span>
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
{#if $organization?.billingPlan === BillingPlan.FREE}
|
||||
<Button
|
||||
fullWidth
|
||||
href={$upgradeURL}
|
||||
on:click={() => {
|
||||
trackEvent('click_organization_upgrade', {
|
||||
from: 'button',
|
||||
source: 'support_menu'
|
||||
});
|
||||
}}>
|
||||
<span class="text">Get Premium support</span>
|
||||
</Button>
|
||||
{:else}
|
||||
<Button
|
||||
secondary
|
||||
fullWidth
|
||||
on:click={() => {
|
||||
show = false;
|
||||
$showSupportModal = false;
|
||||
wizard.start(SupportWizard);
|
||||
}}>
|
||||
<span class="text">Contact our Support Team</span>
|
||||
</Button>
|
||||
{/if}
|
||||
</section>
|
||||
{/if}
|
||||
<section class="drop-section u-grid u-gap-24 u-padding-24">
|
||||
<div>
|
||||
<h4 class="eyebrow-heading-3">Troubleshooting</h4>
|
||||
</Card>
|
||||
{/each}
|
||||
|
||||
<div class="u-margin-block-start-8 u-width-full-line">
|
||||
{#key $app.themeInUse}
|
||||
<iframe
|
||||
style="color-scheme: none"
|
||||
title="Appwrite Status"
|
||||
src={`https://status.appwrite.online/badge?theme=${
|
||||
$app.themeInUse === 'dark' ? 'dark' : 'light'
|
||||
}`}
|
||||
width="250"
|
||||
height="30"
|
||||
frameborder="0"
|
||||
scrolling="no">
|
||||
</iframe>
|
||||
{/key}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="u-flex u-gap-16">
|
||||
<a
|
||||
href="https://appwrite.io/docs"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="button is-secondary u-padding-inline-12 u-stretch u-main-center u-gap-4 u-flex-basis-auto">
|
||||
<span class="icon-book-open" aria-hidden="true" />
|
||||
<span class="text">Docs</span>
|
||||
</a>
|
||||
<a
|
||||
href="https://github.com/appwrite/appwrite/issues"
|
||||
aria-label="Open issue on GitHub"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="button is-secondary u-padding-inline-12 u-stretch u-main-center u-gap-4 u-flex-basis-auto">
|
||||
<span class="icon-github" aria-hidden="true" />
|
||||
<span class="text">Open issue</span>
|
||||
</a>
|
||||
<div class="u-width-full-line">
|
||||
{#key $app.themeInUse}
|
||||
<iframe
|
||||
style="color-scheme: none"
|
||||
title="Appwrite Status"
|
||||
src={`https://status.appwrite.online/badge?theme=${
|
||||
$app.themeInUse === 'dark' ? 'dark' : 'light'
|
||||
}`}
|
||||
width="250"
|
||||
height="30"
|
||||
frameborder="0"
|
||||
scrolling="no">
|
||||
</iframe>
|
||||
{/key}
|
||||
</div>
|
||||
</section>
|
||||
<section class="drop-section u-grid u-gap-8 u-padding-24">
|
||||
<div>
|
||||
<h4 class="eyebrow-heading-3">Community support</h4>
|
||||
<p class="text u-margin-block-start-8">Get help from our community</p>
|
||||
</div>
|
||||
<ul class="u-flex u-gap-8">
|
||||
<li>
|
||||
<Button href="https://github.com/appwrite" text noMargin external ariaLabel="Github">
|
||||
<span class="icon-github" aria-hidden="true" />
|
||||
</Button>
|
||||
</li>
|
||||
<li>
|
||||
<Button
|
||||
href="https://appwrite.io/discord"
|
||||
round
|
||||
text
|
||||
noMargin
|
||||
external
|
||||
ariaLabel="Discord">
|
||||
<span class="icon-discord" aria-hidden="true" />
|
||||
</Button>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.support-section {
|
||||
gap: 1rem;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.support-section {
|
||||
gap: 1.25rem;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -128,6 +128,11 @@ export const localeTimezoneName = () => {
|
||||
return dateWithTimezone.split(', ')[1];
|
||||
};
|
||||
|
||||
export const localeShortTimezoneName = () => {
|
||||
const timezone = localeTimezoneName();
|
||||
return timezone.match(/[A-Z]/g)?.join('') || timezone;
|
||||
};
|
||||
|
||||
export const isSameDay = (date1: Date, date2: Date) => {
|
||||
return (
|
||||
date1.getFullYear() === date2.getFullYear() &&
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
</DropList>
|
||||
|
||||
{#if isCloud}
|
||||
<DropList width="18.5" bind:show={showSupport} scrollable={true}>
|
||||
<DropList width="25" bind:show={showSupport} scrollable={true}>
|
||||
<Button text on:click={() => (showSupport = !showSupport)}>
|
||||
<span class="text">Support</span>
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user