From 64402e824c4d640a31154dcf0b996f20e15147bd Mon Sep 17 00:00:00 2001 From: giancarlo Date: Wed, 17 Apr 2024 21:36:42 +0800 Subject: [PATCH] Refactor billing components for marketing usage A new component 'marketing.tsx' was added to the 'billing-gateway' package, for better organization of marketing-related components. This affects the structure of 'package.json' and requires adjustments in 'index.ts'. The import paths in both marketing-related pages ('pricing/page.tsx', 'page.tsx') were also updated for consistency. --- apps/web/app/(marketing)/page.tsx | 14 +++++++------- apps/web/app/(marketing)/pricing/page.tsx | 2 +- packages/billing/gateway/package.json | 3 ++- packages/billing/gateway/src/components/index.ts | 3 +-- .../billing/gateway/src/components/marketing.tsx | 1 + 5 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 packages/billing/gateway/src/components/marketing.tsx diff --git a/apps/web/app/(marketing)/page.tsx b/apps/web/app/(marketing)/page.tsx index 338919593..6f73bc2ec 100644 --- a/apps/web/app/(marketing)/page.tsx +++ b/apps/web/app/(marketing)/page.tsx @@ -9,7 +9,7 @@ import { Sparkle, } from 'lucide-react'; -import { PricingTable } from '@kit/billing-gateway/components'; +import { PricingTable } from '@kit/billing-gateway/marketing'; import { Button } from '@kit/ui/button'; import { Heading } from '@kit/ui/heading'; import { cn } from '@kit/ui/utils'; @@ -51,7 +51,7 @@ function Home() { Build and launch a SaaS in days, not months @@ -60,17 +60,17 @@ function Home() { Focus on your business, not on the tech Ship something great, today. diff --git a/apps/web/app/(marketing)/pricing/page.tsx b/apps/web/app/(marketing)/pricing/page.tsx index 7d7274e8b..5cdeb23a2 100644 --- a/apps/web/app/(marketing)/pricing/page.tsx +++ b/apps/web/app/(marketing)/pricing/page.tsx @@ -1,4 +1,4 @@ -import { PricingTable } from '@kit/billing-gateway/components'; +import { PricingTable } from '@kit/billing-gateway/marketing'; import { SitePageHeader } from '~/(marketing)/_components/site-page-header'; import billingConfig from '~/config/billing.config'; diff --git a/packages/billing/gateway/package.json b/packages/billing/gateway/package.json index 04086e58e..444dfca05 100644 --- a/packages/billing/gateway/package.json +++ b/packages/billing/gateway/package.json @@ -12,7 +12,8 @@ "exports": { ".": "./src/index.ts", "./components": "./src/components/index.ts", - "./checkout": "./src/components/embedded-checkout.tsx" + "./checkout": "./src/components/embedded-checkout.tsx", + "./marketing": "./src/components/marketing.tsx" }, "peerDependencies": { "@hookform/resolvers": "3.3.4", diff --git a/packages/billing/gateway/src/components/index.ts b/packages/billing/gateway/src/components/index.ts index cb54e3025..f1e5a0065 100644 --- a/packages/billing/gateway/src/components/index.ts +++ b/packages/billing/gateway/src/components/index.ts @@ -2,5 +2,4 @@ export * from './plan-picker'; export * from './current-subscription-card'; export * from './current-lifetime-order-card'; export * from './billing-session-status'; -export * from './billing-portal-card'; -export * from './pricing-table'; +export * from './billing-portal-card'; \ No newline at end of file diff --git a/packages/billing/gateway/src/components/marketing.tsx b/packages/billing/gateway/src/components/marketing.tsx new file mode 100644 index 000000000..7a326de44 --- /dev/null +++ b/packages/billing/gateway/src/components/marketing.tsx @@ -0,0 +1 @@ +export * from './pricing-table';