Skip to content

Commit 936f888

Browse files
committed
fix: free plan tooltip.
1 parent 34de9f5 commit 936f888

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

src/lib/components/billing/planSelection.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
bind:group={billingPlan}
2525
disabled={anyOrgFree || !selfService}
2626
value={BillingPlan.FREE}
27-
tooltipShow={anyOrgFree}
2827
title={tierFree.name}
29-
tooltipText="You are limited to 1 Free organization per account.">
28+
tooltipShow={anyOrgFree}
29+
tooltipText="You are limited to 1 Free organization per account."
30+
tooltipWidth="100%">
3031
<svelte:fragment slot="action">
3132
{#if $organization?.billingPlan === BillingPlan.FREE && !isNewOrg}
3233
<Badge variant="secondary" size="xs" content="Current plan" />

src/lib/components/labelCard.svelte

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script lang="ts">
2-
import { Card, Tooltip } from '@appwrite.io/pink-svelte';
3-
import type { HTMLAttributes } from 'svelte/elements';
4-
import type { BaseCardProps } from './card.svelte';
52
import type { ComponentType } from 'svelte';
3+
import type { BaseCardProps } from './card.svelte';
4+
import type { HTMLAttributes } from 'svelte/elements';
5+
import { Card, Tooltip } from '@appwrite.io/pink-svelte';
66
77
type Props = BaseCardProps &
88
HTMLAttributes<HTMLInputElement> & {
@@ -22,8 +22,10 @@
2222
2323
export let group: string;
2424
export let value: string;
25-
export let tooltipText: string = null;
25+
2626
export let tooltipShow = false;
27+
export let tooltipText: string = null;
28+
export let tooltipWidth: string = undefined;
2729
2830
// Pink v2
2931
export let icon: Props['icon'] = undefined;
@@ -42,25 +44,27 @@
4244
let slotTitle: HTMLSpanElement;
4345
</script>
4446

45-
<Tooltip disabled={!tooltipText || !tooltipShow}>
46-
<Card.Selector
47-
{name}
48-
{src}
49-
{alt}
50-
{icon}
51-
{padding}
52-
{imageRadius}
53-
{variant}
54-
{value}
55-
{radius}
56-
{disabled}
57-
title={title ?? slotTitle?.innerText}
58-
bind:group>
59-
{#if $$slots.default}
60-
<slot />
61-
{/if}
62-
<slot name="action" slot="action" />
63-
</Card.Selector>
47+
<Tooltip maxWidth={tooltipWidth} disabled={!tooltipText || !tooltipShow}>
48+
<div style:cursor={disabled ? 'pointer' : ''}>
49+
<Card.Selector
50+
{name}
51+
{src}
52+
{alt}
53+
{icon}
54+
{padding}
55+
{imageRadius}
56+
{variant}
57+
{value}
58+
{radius}
59+
{disabled}
60+
title={title ?? slotTitle?.innerText}
61+
bind:group>
62+
{#if $$slots.default}
63+
<slot />
64+
{/if}
65+
<slot name="action" slot="action" />
66+
</Card.Selector>
67+
</div>
6468
<span slot="tooltip">{tooltipText}</span>
6569
</Tooltip>
6670

0 commit comments

Comments
 (0)