From e441d5803debf83d54f49571aad2f3198f8af194 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 24 Mar 2025 13:58:12 +0100 Subject: [PATCH] Use new Pink2 wizard --- .../(console)/apply-credit/+page.svelte | 277 ++++++++---------- 1 file changed, 115 insertions(+), 162 deletions(-) diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index 32a59c2b3..b5c817e39 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -11,13 +11,8 @@ import { BillingPlan, Dependencies } from '$lib/constants'; import { Button, Form, InputSelect, InputTags, InputText } from '$lib/elements/forms'; import { toLocaleDate } from '$lib/helpers/date'; - import { - WizardSecondaryContainer, - WizardSecondaryContent, - WizardSecondaryFooter - } from '$lib/layout'; + import { Wizard } from '$lib/layout'; import { type PaymentList } from '$lib/sdk/billing'; - import { app } from '$lib/stores/app'; import { addNotification } from '$lib/stores/notifications'; import { organizationList, type Organization } from '$lib/stores/organization'; import { sdk } from '$lib/stores/sdk'; @@ -212,130 +207,126 @@ Apply credits - Appwrite - - Apply credits - - -
- -
- - {#if $organizationList?.total && !onlyNewOrgs && canSelectOrg} - + + + +
+ + {#if $organizationList?.total && !onlyNewOrgs && canSelectOrg} + + {/if} + {#if selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} + {#if selectedOrgId === newOrgId} + + bind:value={name} /> {/if} + + + + + Invited members will have access to all services and payment + data within your organization + + + + {/if} + +
+ {#if (selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)) || (!data?.couponData?.code && selectedOrgId)} +
+ {#if selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} - {#if selectedOrgId === newOrgId} - - {/if} - - - - - Invited members will have access to all services and - payment data within your organization - - - + {/if} + + {#if !data?.couponData?.code && selectedOrgId} + + + + + + + {/if} +
- {#if (selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)) || (!data?.couponData?.code && selectedOrgId)} -
- - {#if selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} - + {/if} + + + + + {#if selectedOrg?.$id && selectedOrg?.billingPlan !== BillingPlan.FREE && selectedOrg?.billingPlan !== BillingPlan.GITHUB_EDUCATION} +
+ {#if couponData?.code && couponData?.status === 'active'} + +

+ Credits will automatically be applied to your next invoice on {toLocaleDate(selectedOrg?.billingNextInvoiceDate)}. +

+ {:else} +

Add a coupon code to apply credits to your organization.

+ {/if} +
+ {:else if selectedOrgId} +
+ + {#if campaign?.template === 'review' && (campaign?.cta || campaign?.claimed || campaign?.unclaimed)} +
+

{campaign?.cta}

+

+ {#if couponData?.code && couponData?.status === 'active' && campaign?.claimed} + {campaign?.claimed} + {:else if campaign?.unclaimed} + {campaign?.unclaimed} {/if} -

- {#if !data?.couponData?.code && selectedOrgId} - - - - - - - {/if} -
- -
+

+ {/if} -
- -
- - {#if selectedOrg?.$id && selectedOrg?.billingPlan !== BillingPlan.FREE && selectedOrg?.billingPlan !== BillingPlan.GITHUB_EDUCATION} -
- {#if couponData?.code && couponData?.status === 'active'} - -

- Credits will automatically be applied to your next invoice on {toLocaleDate(selectedOrg?.billingNextInvoiceDate)}. -

- {:else} -

Add a coupon code to apply credits to your organization.

- {/if} -
- {:else if selectedOrgId} -
- - {#if campaign?.template === 'review' && (campaign?.cta || campaign?.claimed || campaign?.unclaimed)} -
-

{campaign?.cta}

-

- {#if couponData?.code && couponData?.status === 'active' && campaign?.claimed} - {campaign?.claimed} - {:else if campaign?.unclaimed} - {campaign?.unclaimed} - {/if} -

-
- {/if} -
-
- {/if} -
- - - + + + {/if} + +