From 76b2ba4f93156d099cf081dbff7846ffb07e0f26 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 6 May 2024 17:57:30 +0200 Subject: [PATCH] chore: Add end slot to inputSelectSearch and update import paths for payment methods and payment modal components --- .../billing/selectPaymentMethod.svelte | 9 +- .../billing/validateCreditModal.svelte | 57 +++++ src/lib/elements/forms/inputChoice.svelte | 12 +- .../elements/forms/inputSelectSearch.svelte | 11 + .../console/create-organization/+page.svelte | 230 ++++++++++++++++-- 5 files changed, 292 insertions(+), 27 deletions(-) create mode 100644 src/lib/components/billing/validateCreditModal.svelte diff --git a/src/lib/components/billing/selectPaymentMethod.svelte b/src/lib/components/billing/selectPaymentMethod.svelte index bb5c637d9..97f32e2ef 100644 --- a/src/lib/components/billing/selectPaymentMethod.svelte +++ b/src/lib/components/billing/selectPaymentMethod.svelte @@ -3,9 +3,9 @@ import type { PaymentList, PaymentMethodData } from '$lib/sdk/billing'; import { sdk } from '$lib/stores/sdk'; import { hasStripePublicKey, isCloud } from '$lib/system'; - import PaymentModal from '$routes/console/account/payments/paymentModal.svelte'; import { onMount } from 'svelte'; import { Card, CreditCardBrandImage } from '..'; + import PaymentModal from './paymentModal.svelte'; export let methods: PaymentList; export let value: string; @@ -30,6 +30,7 @@ { return { @@ -48,6 +49,12 @@ + + + {:else} diff --git a/src/lib/components/billing/validateCreditModal.svelte b/src/lib/components/billing/validateCreditModal.svelte new file mode 100644 index 000000000..961e04144 --- /dev/null +++ b/src/lib/components/billing/validateCreditModal.svelte @@ -0,0 +1,57 @@ + + + + Credits will be applied automatically to your next invoice. + + + + + + + + + + diff --git a/src/lib/elements/forms/inputChoice.svelte b/src/lib/elements/forms/inputChoice.svelte index 21d2b48f1..c659e8320 100644 --- a/src/lib/elements/forms/inputChoice.svelte +++ b/src/lib/elements/forms/inputChoice.svelte @@ -1,4 +1,5 @@ @@ -53,9 +150,14 @@ Create organization -
console.log('test')}> + - +

@@ -110,6 +212,7 @@ {#if billingPlan === BillingPlan.PRO} - + {#if !couponData?.code} + + {/if} {/if}

-
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Recusandae, incidunt! -
+ {#if billingPlan !== BillingPlan.STARTER} + + +

{currentPlan.name} plan

+

{formatCurrency(currentPlan.price)}

+
+ +

Additional seats ({collaborators?.length})

+

+ {formatCurrency(extraSeatsCost)} +

+
+ {#if couponData?.status === 'active'} + +
+

+

+ +
+

+ Credits applied +

+
+ {/if} +
+ +

Estimated total

+

+ {formatCurrency(estimatedTotal)} +

+
+ + {@const trialEndDate = new Date( + billingPayDate.getTime() + currentPlan.trialDays * 24 * 60 * 60 * 1000 + )} +

+ Your payment method will be charged this amount plus usage fees every 30 + days {!currentPlan.trialDays + ? `starting ${toLocaleDate(billingPayDate.toString())}` + : ` after your trial period ends on ${toLocaleDate(trialEndDate.toString())}`}. +

+ + + {#if budgetEnabled} +
+ +
+ {/if} +
+
+ + {/if} - - + + + +