Skip to content

Commit 6c22336

Browse files
committed
fix: greptile comments
1 parent 7d6c8c1 commit 6c22336

File tree

2 files changed

+29
-60
lines changed
  • src/routes/(console)

2 files changed

+29
-60
lines changed

src/routes/(console)/organization-[organization]/domains/+page.svelte

Lines changed: 25 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
Layout,
2323
Popover,
2424
Table,
25-
Tooltip,
2625
Typography
2726
} from '@appwrite.io/pink-svelte';
2827
import DeleteDomainModal from './deleteDomainModal.svelte';
@@ -31,23 +30,15 @@
3130
import SearchQuery from '$lib/components/searchQuery.svelte';
3231
import { app } from '$lib/stores/app';
3332
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';
4033
import { columns } from './store';
4134
import { View } from '$lib/helpers/load';
4235
import type { Models } from '@appwrite.io/console';
4336
44-
export let data;
45-
46-
$: isDomainLimitReached = isServiceLimited('domains', $organization, data.domains.total);
37+
let { data } = $props();
4738
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);
5142
5243
const isDomainVerified = (domain: Models.Domain) => {
5344
return domain.nameservers.toLowerCase() === 'appwrite';
@@ -59,28 +50,16 @@
5950
<SearchQuery placeholder="Search domains" />
6051
<Layout.Stack direction="row" gap="m" inline>
6152
<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>
8463
</Layout.Stack>
8564
</Layout.Stack>
8665

@@ -227,29 +206,17 @@
227206
size="s"
228207
ariaLabel="add domain">Documentation</Button>
229208

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>
253220
</svelte:fragment>
254221
</Empty>
255222
</Card.Base>

src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
import { organization } from '$lib/stores/organization';
1818
import Table from './table.svelte';
1919
20-
export let data;
20+
let { data } = $props();
2121
22-
$: isDomainLimitReached = isServiceLimited('domains', $organization, data.proxyRules.total);
22+
const isDomainLimitReached = $derived(
23+
isServiceLimited('domains', $organization, data.proxyRules.total)
24+
);
2325
</script>
2426

2527
<Container>

0 commit comments

Comments
 (0)