Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/public-files-throw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/astro': minor
---

Add `<PricingTable />` component to the SDK. Learn more about it in the [Clerk Billing guide](https://clerk.com/docs/billing/overview).
1 change: 1 addition & 0 deletions integration/presets/longRunningApps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const createLongRunningApps = () => {
{ id: 'withBilling.next.appRouter', config: next.appRouter, env: envs.withBilling },
{ id: 'withBillingStaging.vue.vite', config: vue.vite, env: envs.withBillingStaging },
{ id: 'withBilling.vue.vite', config: vue.vite, env: envs.withBilling },
{ id: 'withBilling.astro.node', config: astro.node, env: envs.withBilling },
// { id: 'withBillingStaging.nuxt.node', config: nuxt.node, env: envs.withBillingStaging },
// { id: 'withBilling.nuxt.node', config: nuxt.node, env: envs.withBilling },
{
Expand Down
10 changes: 10 additions & 0 deletions integration/templates/astro-node/src/pages/pricing-table.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
import { PricingTable } from "@clerk/astro/components";
import Layout from "../layouts/Layout.astro";
---

<Layout title="Pricing Table">
<div class="w-full flex justify-center">
<PricingTable />
</div>
</Layout>
1 change: 1 addition & 0 deletions packages/astro/src/astro-components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ export { OrganizationSwitcher } from './interactive/OrganizationSwitcher';
export { default as OrganizationList } from './interactive/OrganizationList.astro';
export { default as GoogleOneTap } from './interactive/GoogleOneTap.astro';
export { default as Waitlist } from './interactive/Waitlist.astro';
export { default as PricingTable } from './interactive/PricingTable.astro';
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ interface Props {
| 'user-button'
| 'user-profile'
| 'google-one-tap'
| 'waitlist';
| 'waitlist'
| 'pricing-table';
}

import { generateSafeId } from '@clerk/astro/internal';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
import type { PricingTableProps } from "@clerk/types";
type Props = PricingTableProps

import InternalUIComponentRenderer from './InternalUIComponentRenderer.astro'
---

<InternalUIComponentRenderer {...Astro.props} component="pricing-table" />
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const mountAllClerkAstroJSComponents = () => {
'sign-up': 'mountSignUp',
'google-one-tap': 'openGoogleOneTap',
waitlist: 'mountWaitlist',
'pricing-table': 'mountPricingTable',
} as const;

Object.entries(mountFns).forEach(([category, mountFn]) => {
Expand Down
11 changes: 11 additions & 0 deletions packages/astro/src/react/uiComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
OrganizationListProps,
OrganizationProfileProps,
OrganizationSwitcherProps,
PricingTableProps,
SignInProps,
SignUpProps,
UserButtonProps,
Expand Down Expand Up @@ -185,3 +186,13 @@ export const Waitlist = withClerk(({ clerk, ...props }: WithClerkProp<WaitlistPr
/>
);
}, 'Waitlist');

export const PricingTable = withClerk(({ clerk, ...props }: WithClerkProp<PricingTableProps>) => {
return (
<Portal
mount={clerk?.mountPricingTable}
unmount={clerk?.unmountPricingTable}
props={props}
/>
);
}, 'PricingTable');