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.
This commit is contained in:
giancarlo
2024-04-17 21:36:42 +08:00
parent 5a74f93d26
commit 64402e824c
5 changed files with 12 additions and 11 deletions

View File

@@ -9,7 +9,7 @@ import {
Sparkle, Sparkle,
} from 'lucide-react'; } from 'lucide-react';
import { PricingTable } from '@kit/billing-gateway/components'; import { PricingTable } from '@kit/billing-gateway/marketing';
import { Button } from '@kit/ui/button'; import { Button } from '@kit/ui/button';
import { Heading } from '@kit/ui/heading'; import { Heading } from '@kit/ui/heading';
import { cn } from '@kit/ui/utils'; import { cn } from '@kit/ui/utils';
@@ -51,7 +51,7 @@ function Home() {
<Heading <Heading
level={2} level={2}
className={ className={
'text-center font-sans text-2xl font-normal text-muted-foreground p-0' 'p-0 text-center font-sans text-2xl font-normal text-muted-foreground'
} }
> >
<span>Build and launch a SaaS in days, not months</span> <span>Build and launch a SaaS in days, not months</span>
@@ -60,17 +60,17 @@ function Home() {
<Heading <Heading
level={2} level={2}
className={ className={
'text-center font-sans text-2xl font-normal text-muted-foreground p-0' 'p-0 text-center font-sans text-2xl font-normal text-muted-foreground'
} }
> >
<span>Focus on your business, not on the tech</span> <span>Focus on your business, not on the tech</span>
</Heading> </Heading>
<Heading <Heading
level={2} level={2}
className={ className={
'text-center font-sans text-2xl font-normal text-muted-foreground p-0' 'p-0 text-center font-sans text-2xl font-normal text-muted-foreground'
} }
> >
Ship something great, today. Ship something great, today.
</Heading> </Heading>

View File

@@ -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 { SitePageHeader } from '~/(marketing)/_components/site-page-header';
import billingConfig from '~/config/billing.config'; import billingConfig from '~/config/billing.config';

View File

@@ -12,7 +12,8 @@
"exports": { "exports": {
".": "./src/index.ts", ".": "./src/index.ts",
"./components": "./src/components/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": { "peerDependencies": {
"@hookform/resolvers": "3.3.4", "@hookform/resolvers": "3.3.4",

View File

@@ -2,5 +2,4 @@ export * from './plan-picker';
export * from './current-subscription-card'; export * from './current-subscription-card';
export * from './current-lifetime-order-card'; export * from './current-lifetime-order-card';
export * from './billing-session-status'; export * from './billing-session-status';
export * from './billing-portal-card'; export * from './billing-portal-card';
export * from './pricing-table';

View File

@@ -0,0 +1 @@
export * from './pricing-table';