diff --git a/apps/web/src/app/(dashboard)/settings/billing/billing-portal-button.tsx b/apps/web/src/app/(dashboard)/settings/billing/billing-portal-button.tsx index da230908a..c8ab8c132 100644 --- a/apps/web/src/app/(dashboard)/settings/billing/billing-portal-button.tsx +++ b/apps/web/src/app/(dashboard)/settings/billing/billing-portal-button.tsx @@ -12,9 +12,10 @@ import { createBillingPortal } from './create-billing-portal.action'; export type BillingPortalButtonProps = { buttonProps?: React.ComponentProps; + children?: React.ReactNode; }; -export const BillingPortalButton = ({ buttonProps }: BillingPortalButtonProps) => { +export const BillingPortalButton = ({ buttonProps, children }: BillingPortalButtonProps) => { const { _ } = useLingui(); const { toast } = useToast(); @@ -63,7 +64,7 @@ export const BillingPortalButton = ({ buttonProps }: BillingPortalButtonProps) = onClick={async () => handleFetchPortalUrl()} loading={isFetchingPortalUrl} > - Manage Subscription + {children || Manage Subscription} ); }; diff --git a/apps/web/src/app/(dashboard)/settings/billing/page.tsx b/apps/web/src/app/(dashboard)/settings/billing/page.tsx index e60698818..05be0c6cb 100644 --- a/apps/web/src/app/(dashboard)/settings/billing/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/billing/page.tsx @@ -68,60 +68,74 @@ export default async function BillingSettingsPage() { return (
-

- Billing -

+
+
+

+ Billing +

-
- {isMissingOrInactiveOrFreePlan && ( -

- - You are currently on the Free Plan. - -

- )} - - {/* Todo: Translation */} - {!isMissingOrInactiveOrFreePlan && - match(subscription.status) - .with('ACTIVE', () => ( -

- {subscriptionProduct ? ( - - You are currently subscribed to{' '} - {subscriptionProduct.name} - - ) : ( - You currently have an active plan - )} - - {subscription.periodEnd && ( - - {' '} - which is set to{' '} - {subscription.cancelAtPeriodEnd ? ( - - end on{' '} - {i18n.date(subscription.periodEnd)}. - - ) : ( - - automatically renew on{' '} - {i18n.date(subscription.periodEnd)}. - - )} - - )} -

- )) - .with('PAST_DUE', () => ( +
+ {isMissingOrInactiveOrFreePlan && (

- Your current plan is past due. Please update your payment information. + You are currently on the Free Plan.

- )) - .otherwise(() => null)} + )} + + {/* Todo: Translation */} + {!isMissingOrInactiveOrFreePlan && + match(subscription.status) + .with('ACTIVE', () => ( +

+ {subscriptionProduct ? ( + + You are currently subscribed to{' '} + {subscriptionProduct.name} + + ) : ( + You currently have an active plan + )} + + {subscription.periodEnd && ( + + {' '} + which is set to{' '} + {subscription.cancelAtPeriodEnd ? ( + + end on{' '} + + {i18n.date(subscription.periodEnd)}. + + + ) : ( + + automatically renew on{' '} + + {i18n.date(subscription.periodEnd)}. + + + )} + + )} +

+ )) + .with('PAST_DUE', () => ( +

+ + Your current plan is past due. Please update your payment information. + +

+ )) + .otherwise(() => null)} +
+
+ + {isMissingOrInactiveOrFreePlan && ( + + Manage billing + + )}

diff --git a/packages/api/v1/contract.ts b/packages/api/v1/contract.ts index cd90c31c4..c21358c28 100644 --- a/packages/api/v1/contract.ts +++ b/packages/api/v1/contract.ts @@ -168,6 +168,9 @@ export const ApiContractV1 = c.router( 500: ZUnsuccessfulResponseSchema, }, summary: 'Send a document for signing', + // I'm aware this should be in the variable itself, which it is, however it's difficult for users to find in our current UI. + description: + 'Notes\n\n`sendEmail` - Whether to send an email to the recipients asking them to action the document. If you disable this, you will need to manually distribute the document to the recipients using the generated signing links. Defaults to true', }, resendDocument: { diff --git a/packages/api/v1/schema.ts b/packages/api/v1/schema.ts index a4fab1089..87e17ba8b 100644 --- a/packages/api/v1/schema.ts +++ b/packages/api/v1/schema.ts @@ -67,7 +67,10 @@ export type TSuccessfulDocumentResponseSchema = z.infer ({ sendEmail: true })));