From 7112560efec5bc5cd13b2b3c11fd9933df6374bb Mon Sep 17 00:00:00 2001 From: giancarlo Date: Sat, 6 Apr 2024 12:37:44 +0800 Subject: [PATCH] Update UI styling and fix bug in tier limits Modified styles in radio-group, line-item-details and plan-picker components for improved user interface consistency. Specifically, certain font weights and transitions were adjusted, and some CSS classes were changed. Additionally, a bug in line-item-details was fixed where the 'unlimited' value wasn't properly returned for the previous tier's limit. --- .../gateway/src/components/line-item-details.tsx | 4 ++-- .../gateway/src/components/plan-picker.tsx | 15 +++++++++++---- packages/ui/src/shadcn/radio-group.tsx | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/billing/gateway/src/components/line-item-details.tsx b/packages/billing/gateway/src/components/line-item-details.tsx index f67c813eb..0c3d9051b 100644 --- a/packages/billing/gateway/src/components/line-item-details.tsx +++ b/packages/billing/gateway/src/components/line-item-details.tsx @@ -165,11 +165,11 @@ function Tiers({ const isNoLimit = tier.upTo === 'unlimited'; const previousTierFrom = - tier.upTo === 'unlimited' + previousTier?.upTo === 'unlimited' ? 'unlimited' : previousTier === undefined ? 0 - : (previousTier?.upTo as number) + 1 || 0; + : previousTier.upTo + 1 || 0; const upTo = tier.upTo; const isIncluded = tier.cost === 0; diff --git a/packages/billing/gateway/src/components/plan-picker.tsx b/packages/billing/gateway/src/components/plan-picker.tsx index fc44cf531..5325bd064 100644 --- a/packages/billing/gateway/src/components/plan-picker.tsx +++ b/packages/billing/gateway/src/components/plan-picker.tsx @@ -144,7 +144,7 @@ export function PlanPicker( className={cn( 'hover:bg-muted flex items-center space-x-2 rounded-md border border-transparent px-4 py-2', { - ['border-border']: selected, + ['border-primary']: selected, ['hover:bg-muted']: !selected, }, )} @@ -167,7 +167,12 @@ export function PlanPicker( }} /> - + @@ -248,7 +253,7 @@ export function PlanPicker( 'flex flex-col justify-center space-y-2' } > - +
@@ -429,6 +434,8 @@ function PlanDetails({ />
+ +
diff --git a/packages/ui/src/shadcn/radio-group.tsx b/packages/ui/src/shadcn/radio-group.tsx index 8b1cade91..dc1d6a8cd 100644 --- a/packages/ui/src/shadcn/radio-group.tsx +++ b/packages/ui/src/shadcn/radio-group.tsx @@ -54,7 +54,7 @@ const RadioGroupItemLabel = ( props.className, 'flex cursor-pointer rounded-md' + ' items-center space-x-4 border border-input hover:bg-muted' + - ' transition-duration-500 p-4 text-sm transition-colors focus-within:border-primary', + ' transition-duration-500 p-4 text-sm transition-all focus-within:border-primary', { [`border-primary`]: props.selected, },