Skip to content

Commit 895a1a3

Browse files
octoperLekoArts
andauthored
feat(astro): Add <PricingTable /> component (#5774)
Co-authored-by: Lennart <lekoarts@gmail.com>
1 parent 96a6ada commit 895a1a3

8 files changed

Lines changed: 39 additions & 1 deletion

File tree

.changeset/public-files-throw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/astro': minor
3+
---
4+
5+
Add `<PricingTable />` component to the SDK. Learn more about it in the [Clerk Billing guide](https://clerk.com/docs/billing/overview).

integration/presets/longRunningApps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const createLongRunningApps = () => {
4646
{ id: 'withBilling.next.appRouter', config: next.appRouter, env: envs.withBilling },
4747
{ id: 'withBillingStaging.vue.vite', config: vue.vite, env: envs.withBillingStaging },
4848
{ id: 'withBilling.vue.vite', config: vue.vite, env: envs.withBilling },
49+
{ id: 'withBilling.astro.node', config: astro.node, env: envs.withBilling },
4950
// { id: 'withBillingStaging.nuxt.node', config: nuxt.node, env: envs.withBillingStaging },
5051
// { id: 'withBilling.nuxt.node', config: nuxt.node, env: envs.withBilling },
5152
{
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
import { PricingTable } from "@clerk/astro/components";
3+
import Layout from "../layouts/Layout.astro";
4+
---
5+
6+
<Layout title="Pricing Table">
7+
<div class="w-full flex justify-center">
8+
<PricingTable />
9+
</div>
10+
</Layout>

packages/astro/src/astro-components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ export { OrganizationSwitcher } from './interactive/OrganizationSwitcher';
2525
export { default as OrganizationList } from './interactive/OrganizationList.astro';
2626
export { default as GoogleOneTap } from './interactive/GoogleOneTap.astro';
2727
export { default as Waitlist } from './interactive/Waitlist.astro';
28+
export { default as PricingTable } from './interactive/PricingTable.astro';

packages/astro/src/astro-components/interactive/InternalUIComponentRenderer.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ interface Props {
1111
| 'user-button'
1212
| 'user-profile'
1313
| 'google-one-tap'
14-
| 'waitlist';
14+
| 'waitlist'
15+
| 'pricing-table';
1516
}
1617
1718
import { generateSafeId } from '@clerk/astro/internal';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
import type { PricingTableProps } from "@clerk/types";
3+
type Props = PricingTableProps
4+
5+
import InternalUIComponentRenderer from './InternalUIComponentRenderer.astro'
6+
---
7+
8+
<InternalUIComponentRenderer {...Astro.props} component="pricing-table" />

packages/astro/src/internal/mount-clerk-astro-js-components.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const mountAllClerkAstroJSComponents = () => {
1414
'sign-up': 'mountSignUp',
1515
'google-one-tap': 'openGoogleOneTap',
1616
waitlist: 'mountWaitlist',
17+
'pricing-table': 'mountPricingTable',
1718
} as const;
1819

1920
Object.entries(mountFns).forEach(([category, mountFn]) => {

packages/astro/src/react/uiComponents.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {
33
OrganizationListProps,
44
OrganizationProfileProps,
55
OrganizationSwitcherProps,
6+
PricingTableProps,
67
SignInProps,
78
SignUpProps,
89
UserButtonProps,
@@ -185,3 +186,13 @@ export const Waitlist = withClerk(({ clerk, ...props }: WithClerkProp<WaitlistPr
185186
/>
186187
);
187188
}, 'Waitlist');
189+
190+
export const PricingTable = withClerk(({ clerk, ...props }: WithClerkProp<PricingTableProps>) => {
191+
return (
192+
<Portal
193+
mount={clerk?.mountPricingTable}
194+
unmount={clerk?.unmountPricingTable}
195+
props={props}
196+
/>
197+
);
198+
}, 'PricingTable');

0 commit comments

Comments
 (0)