From e00cb3c591bece1cc799a2915924c05aa8a87114 Mon Sep 17 00:00:00 2001 From: giancarlo Date: Wed, 10 Apr 2024 22:24:11 +0800 Subject: [PATCH] Refactor logger usage and add discount field to checkout This commit refactors the logger usage in various files to make it more streamlined and consistent. It also introduces a new 'enableDiscountField' feature for the checkout that can be toggled on specific products. This allows customers to apply discounts at checkout if the product or subscription plan has the 'enableDiscountField' set to true. --- .../site-header-account-section.tsx | 2 +- .../_components/site-navigation-item.tsx | 2 +- .../gateway/src/components/pricing-table.tsx | 22 ++++++------------- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/apps/web/app/(marketing)/_components/site-header-account-section.tsx b/apps/web/app/(marketing)/_components/site-header-account-section.tsx index 526a396d2..19352b5ef 100644 --- a/apps/web/app/(marketing)/_components/site-header-account-section.tsx +++ b/apps/web/app/(marketing)/_components/site-header-account-section.tsx @@ -61,7 +61,7 @@ function AuthButtons() { - diff --git a/apps/web/app/(marketing)/_components/site-navigation-item.tsx b/apps/web/app/(marketing)/_components/site-navigation-item.tsx index 576f313de..aad93d850 100644 --- a/apps/web/app/(marketing)/_components/site-navigation-item.tsx +++ b/apps/web/app/(marketing)/_components/site-navigation-item.tsx @@ -9,7 +9,7 @@ import { cn, isRouteActive } from '@kit/ui/utils'; const getClassName = (path: string, currentPathName: string) => { const isActive = isRouteActive(path, currentPathName); - return cn(`text-sm font-medium text-primary`, { + return cn(`text-sm font-medium`, { 'hover:underline': !isActive, }); }; diff --git a/packages/billing/gateway/src/components/pricing-table.tsx b/packages/billing/gateway/src/components/pricing-table.tsx index 9c9b967d9..8ac297d3d 100644 --- a/packages/billing/gateway/src/components/pricing-table.tsx +++ b/packages/billing/gateway/src/components/pricing-table.tsx @@ -152,11 +152,12 @@ function PricingItem( data-cy={'subscription-plan'} className={cn( props.className, - `s-full bg-background flex flex-1 grow flex-col items-stretch justify-between space-y-8 self-stretch - rounded-lg border border-transparent p-6 lg:w-4/12 xl:max-w-[22rem] xl:p-8`, + `s-full flex flex-1 grow flex-col items-stretch justify-between space-y-8 self-stretch + rounded-lg p-6 ring-2 lg:w-4/12 xl:max-w-[22rem] xl:p-8`, { - ['border-primary']: highlighted, - ['dark:shadow-primary/20 shadow dark:shadow-sm']: !highlighted, + ['ring-primary']: highlighted, + ['dark:shadow-primary/30 shadow-none ring-transparent dark:shadow-sm']: + !highlighted, }, )} > @@ -173,12 +174,7 @@ function PricingItem( - + @@ -345,11 +341,7 @@ function Price({ children }: React.PropsWithChildren) { function ListItem({ children }: React.PropsWithChildren) { return (
  • - +