|
22 | 22 | Layout, |
23 | 23 | Popover, |
24 | 24 | Table, |
25 | | - Tooltip, |
26 | 25 | Typography |
27 | 26 | } from '@appwrite.io/pink-svelte'; |
28 | 27 | import DeleteDomainModal from './deleteDomainModal.svelte'; |
|
31 | 30 | import SearchQuery from '$lib/components/searchQuery.svelte'; |
32 | 31 | import { app } from '$lib/stores/app'; |
33 | 32 | import { Click, trackEvent } from '$lib/actions/analytics'; |
34 | | - import { |
35 | | - BODY_TOOLTIP_MAX_WIDTH, |
36 | | - BODY_TOOLTIP_WRAPPER_STYLE_PRELINE |
37 | | - } from '$lib/helpers/tooltipContent'; |
38 | | - import { isServiceLimited } from '$lib/stores/billing'; |
39 | | - import { organization } from '$lib/stores/organization'; |
40 | 33 | import { columns } from './store'; |
41 | 34 | import { View } from '$lib/helpers/load'; |
42 | 35 | import type { Models } from '@appwrite.io/console'; |
43 | 36 |
|
44 | | - export let data; |
45 | | -
|
46 | | - $: isDomainLimitReached = isServiceLimited('domains', $organization, data.domains.total); |
| 37 | + let { data } = $props(); |
47 | 38 |
|
48 | | - let showDelete = false; |
49 | | - let showRetry = false; |
50 | | - let selectedDomain: Models.Domain = null; |
| 39 | + let showDelete = $state(false); |
| 40 | + let showRetry = $state(false); |
| 41 | + let selectedDomain = $state<Models.Domain | null>(null); |
51 | 42 |
|
52 | 43 | const isDomainVerified = (domain: Models.Domain) => { |
53 | 44 | return domain.nameservers.toLowerCase() === 'appwrite'; |
|
59 | 50 | <SearchQuery placeholder="Search domains" /> |
60 | 51 | <Layout.Stack direction="row" gap="m" inline> |
61 | 52 | <ViewSelector ui="new" view={View.Table} {columns} hideView /> |
62 | | - <Tooltip disabled={!isDomainLimitReached} maxWidth={BODY_TOOLTIP_MAX_WIDTH}> |
63 | | - <div> |
64 | | - <Button |
65 | | - disabled={isDomainLimitReached} |
66 | | - on:click={() => { |
67 | | - trackEvent(Click.DomainCreateClick, { |
68 | | - source: 'organization_domain_overview' |
69 | | - }); |
70 | | - }} |
71 | | - href={isDomainLimitReached |
72 | | - ? undefined |
73 | | - : `${base}/organization-${page.params.organization}/domains/add-domain`}> |
74 | | - <Icon icon={IconPlus} size="s" /> |
75 | | - Add domain |
76 | | - </Button> |
77 | | - </div> |
78 | | - <svelte:fragment slot="tooltip"> |
79 | | - <div style={BODY_TOOLTIP_WRAPPER_STYLE_PRELINE}> |
80 | | - You have reached the maximum number of custom domains for your plan. |
81 | | - </div> |
82 | | - </svelte:fragment> |
83 | | - </Tooltip> |
| 53 | + <Button |
| 54 | + on:click={() => { |
| 55 | + trackEvent(Click.DomainCreateClick, { |
| 56 | + source: 'organization_domain_overview' |
| 57 | + }); |
| 58 | + }} |
| 59 | + href={`${base}/organization-${page.params.organization}/domains/add-domain`}> |
| 60 | + <Icon icon={IconPlus} size="s" /> |
| 61 | + Add domain |
| 62 | + </Button> |
84 | 63 | </Layout.Stack> |
85 | 64 | </Layout.Stack> |
86 | 65 |
|
|
227 | 206 | size="s" |
228 | 207 | ariaLabel="add domain">Documentation</Button> |
229 | 208 |
|
230 | | - <Tooltip disabled={!isDomainLimitReached} maxWidth={BODY_TOOLTIP_MAX_WIDTH}> |
231 | | - <div> |
232 | | - <Button |
233 | | - secondary |
234 | | - disabled={isDomainLimitReached} |
235 | | - on:click={() => { |
236 | | - trackEvent(Click.DomainCreateClick, { |
237 | | - source: 'organization_domain_overview' |
238 | | - }); |
239 | | - }} |
240 | | - href={isDomainLimitReached |
241 | | - ? undefined |
242 | | - : `${base}/organization-${page.params.organization}/domains/add-domain`} |
243 | | - size="s"> |
244 | | - Add domain |
245 | | - </Button> |
246 | | - </div> |
247 | | - <svelte:fragment slot="tooltip"> |
248 | | - <div style={BODY_TOOLTIP_WRAPPER_STYLE_PRELINE}> |
249 | | - You have reached the maximum number of custom domains for your plan. |
250 | | - </div> |
251 | | - </svelte:fragment> |
252 | | - </Tooltip> |
| 209 | + <Button |
| 210 | + secondary |
| 211 | + on:click={() => { |
| 212 | + trackEvent(Click.DomainCreateClick, { |
| 213 | + source: 'organization_domain_overview' |
| 214 | + }); |
| 215 | + }} |
| 216 | + href={`${base}/organization-${page.params.organization}/domains/add-domain`} |
| 217 | + size="s"> |
| 218 | + Add domain |
| 219 | + </Button> |
253 | 220 | </svelte:fragment> |
254 | 221 | </Empty> |
255 | 222 | </Card.Base> |
|
0 commit comments