fix: estimate box and exit modal

This commit is contained in:
Arman committed 2024-05-28 15:59:48 +02:00
1 parent af5d97aaba
commit 849ac64062
4 files changed
+35 -21

No files matched your search

@@ -10,6 +10,7 @@
export let collaborators: string[];
export let couponData: Partial<Coupon>;
export let billingBudget: number;
export let fixedCoupon = false; // If true, the coupon cannot be removed
const today = new Date();
const billingPayDate = new Date(today.getTime() + 30 * 24 * 60 * 60 * 1000);
@@ -30,7 +31,9 @@
);
</script>
<section class="card u-margin-block-start-32 u-flex u-flex-vertical u-gap-8">
<section
class="card u-margin-block-start-32 u-flex u-flex-vertical u-gap-8"
style:--p-card-padding="1.5rem">
<span class="u-flex u-main-space-between">
<p class="text">{currentPlan.name} plan</p>
<p class="text">{formatCurrency(currentPlan.price)}</p>
@@ -53,20 +56,22 @@
>Credits applied</span>
{/if}
</p>
<button
type="button"
class="button is-text is-only-icon"
style="--button-size:1.5rem;"
aria-label="Close"
title="Close"
on:click={() =>
(couponData = {
code: null,
status: null,
credits: null
})}>
<span class="icon-x" aria-hidden="true" />
</button>
{#if !fixedCoupon}
<button
type="button"
class="button is-text is-only-icon"
style="--button-size:1.5rem;"
aria-label="Close"
title="Close"
on:click={() =>
(couponData = {
code: null,
status: null,
credits: null
})}>
<span class="icon-x" aria-hidden="true" />
</button>
{/if}
</div>
{#if couponData.credits > 100}
<p class="inline-tag" use:tooltip={{ content: formatCurrency(couponData.credits) }}>
+2 -3
View File
@@ -20,9 +20,8 @@
icon="exclamation"
state="warning"
headerDivider={false}>
<p>
Are you sure you want to exit from <slot />? All data will be deleted. This action is
irreversible.
<p class="text">
<slot />
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (show = false)}>Cancel</Button>
+4 -1
View File
@@ -44,6 +44,9 @@
from: 'prompt'
});
}}>
<slot name="exit">this process</slot>
<slot name="exit">
Are you sure you want to exit from this process? All data will be deleted. This action
is irreversible.
</slot>
</WizardExitModal>
{/if}
+9 -2
View File
@@ -156,7 +156,13 @@
</svelte:head>
<WizardSecondaryContainer>
<WizardSecondaryHeader href={previousPage}>Apply credits</WizardSecondaryHeader>
<WizardSecondaryHeader showExitModal href={previousPage}
>Apply credits
<svelte:fragment slot="exit">
You can apply your credits to an organization at a later date. All other data entered
will be lost. Credits expire {toLocaleDate(data.couponData.expiration)}.
</svelte:fragment>
</WizardSecondaryHeader>
<WizardSecondaryContent>
{#if $organizationList?.total}
<FormList>
@@ -208,7 +214,7 @@
</div>
</div>
{#if selectedOrg?.billingPlan === BillingPlan.PRO}
<section class="card u-margin-block-start-32">
<section class="card u-margin-block-start-32" style:--p-card-padding="1.5rem">
<p class="text">
Credits will automatically be applied to your next invoice on <b
>{toLocaleDate(selectedOrg.billingNextInvoiceDate)}.</b>
@@ -216,6 +222,7 @@
</section>
{:else if selectedOrgId}
<EstimatedTotalBox
fixedCoupon
billingPlan={BillingPlan.PRO}
{collaborators}
bind:couponData={data.couponData}