From bb4e318c54a3da13355ad2346ea3abb374b88ba4 Mon Sep 17 00:00:00 2001 From: gbuomprisco Date: Tue, 18 Feb 2025 14:26:57 +0700 Subject: [PATCH] Improve pricing table design --- apps/web/public/locales/en/billing.json | 2 +- .../gateway/src/components/pricing-table.tsx | 86 ++++++++++++------- 2 files changed, 54 insertions(+), 34 deletions(-) diff --git a/apps/web/public/locales/en/billing.json b/apps/web/public/locales/en/billing.json index 81fac4ede..9efef3536 100644 --- a/apps/web/public/locales/en/billing.json +++ b/apps/web/public/locales/en/billing.json @@ -26,7 +26,7 @@ "month": "Billed monthly", "year": "Billed yearly" }, - "perMonth": "per month", + "perMonth": "month", "custom": "Custom Plan", "lifetime": "Lifetime", "trialPeriod": "{{period}} day trial", diff --git a/packages/billing/gateway/src/components/pricing-table.tsx b/packages/billing/gateway/src/components/pricing-table.tsx index 99c1bf2fc..d79ddbd73 100644 --- a/packages/billing/gateway/src/components/pricing-table.tsx +++ b/packages/billing/gateway/src/components/pricing-table.tsx @@ -17,7 +17,6 @@ import { import { Badge } from '@kit/ui/badge'; import { Button } from '@kit/ui/button'; import { If } from '@kit/ui/if'; -import { Separator } from '@kit/ui/separator'; import { Trans } from '@kit/ui/trans'; import { cn } from '@kit/ui/utils'; @@ -172,7 +171,7 @@ function PricingItem( data-cy={'subscription-plan'} className={cn( props.className, - `s-full relative flex flex-1 grow flex-col items-stretch justify-between self-stretch rounded-lg border p-8 lg:w-4/12 xl:max-w-[20rem]`, + `s-full relative flex flex-1 grow flex-col items-stretch justify-between self-stretch rounded-lg border px-6 py-5 lg:w-4/12 xl:max-w-[20rem]`, { ['border-primary']: highlighted, ['border-border']: !highlighted, @@ -195,12 +194,12 @@ function PricingItem( -
-
+
+
- - - -
- - -
- - +
+ + + } + > @@ -298,7 +296,14 @@ function PricingItem( - + + + + +
- +
@@ -330,14 +335,14 @@ function PricingItem( function FeaturesList( props: React.PropsWithChildren<{ features: string[]; - highlighted?: boolean; + highlighted: boolean; }>, ) { return ( -
    +
      {props.features.map((feature) => { return ( - + ); @@ -349,23 +354,27 @@ function FeaturesList( function Price({ children, isMonthlyPrice = true, + displayBillingPeriod = true, }: React.PropsWithChildren<{ isMonthlyPrice?: boolean; + displayBillingPeriod?: boolean; }>) { return (
      {children} - + + / + @@ -373,14 +382,25 @@ function Price({ ); } -function ListItem({ children }: React.PropsWithChildren) { +function ListItem({ + children, + highlighted, +}: React.PropsWithChildren<{ + highlighted: boolean; +}>) { return ( -
    • - +
    • + {children} @@ -477,10 +497,10 @@ function DefaultCheckoutButton(