Skip to content

Commit 70768b0

Browse files
authored
Merge pull request #2400 from appwrite/fix-remove-scale-plan-comparision
2 parents 460f1a6 + ea09b04 commit 70768b0

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

src/lib/components/billing/planComparisonBox.svelte

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
11
<script lang="ts">
22
import { BillingPlan } from '$lib/constants';
33
import { formatNum } from '$lib/helpers/string';
4-
import { plansInfo, tierFree, tierPro, tierScale, type Tier } from '$lib/stores/billing';
4+
import { plansInfo, tierToPlan, type Tier } from '$lib/stores/billing';
55
import { Card, Layout, Tabs, Typography } from '@appwrite.io/pink-svelte';
66
77
export let downgrade = false;
88
99
let selectedTab: Tier = BillingPlan.FREE;
1010
1111
$: plan = $plansInfo.get(selectedTab);
12+
13+
const allTiers: Tier[] = [BillingPlan.FREE, BillingPlan.PRO, BillingPlan.SCALE];
14+
$: visibleTiers = allTiers.filter((tier) => tier !== BillingPlan.SCALE);
1215
</script>
1316

1417
<Card.Base>
1518
<Layout.Stack>
1619
<Tabs.Root stretch let:root>
17-
<Tabs.Item.Button
18-
{root}
19-
active={selectedTab === BillingPlan.FREE}
20-
on:click={() => (selectedTab = BillingPlan.FREE)}>
21-
{tierFree.name}
22-
</Tabs.Item.Button>
23-
<Tabs.Item.Button
24-
{root}
25-
active={selectedTab === BillingPlan.PRO}
26-
on:click={() => (selectedTab = BillingPlan.PRO)}>
27-
{tierPro.name}
28-
</Tabs.Item.Button>
29-
<Tabs.Item.Button
30-
{root}
31-
active={selectedTab === BillingPlan.SCALE}
32-
on:click={() => (selectedTab = BillingPlan.SCALE)}>
33-
{tierScale.name}
34-
</Tabs.Item.Button>
20+
{#each visibleTiers as tier}
21+
<Tabs.Item.Button
22+
{root}
23+
active={selectedTab === tier}
24+
on:click={() => (selectedTab = tier)}>
25+
{tierToPlan(tier).name}
26+
</Tabs.Item.Button>
27+
{/each}
3528
</Tabs.Root>
3629

3730
<Typography.Text variant="m-600">{plan.name} plan</Typography.Text>

0 commit comments

Comments
 (0)