Skip to content

Commit dcf50c3

Browse files
committed
feat(astro): Introduce <Waitlist /> component
1 parent c7f509e commit dcf50c3

File tree

6 files changed

+39
-4
lines changed

6 files changed

+39
-4
lines changed

.changeset/empty-roses-peel.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+
Introduce `<Waitlist />` component for Astro

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

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

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
---
22
interface Props {
3-
[key: string]: unknown
4-
id?: string
5-
component: 'sign-in' | 'sign-up' | 'organization-list' | 'organization-profile' | 'organization-switcher' | 'user-button' | 'user-profile' | 'google-one-tap'
3+
[key: string]: unknown;
4+
id?: string;
5+
component:
6+
| 'sign-in'
7+
| 'sign-up'
8+
| 'organization-list'
9+
| 'organization-profile'
10+
| 'organization-switcher'
11+
| 'user-button'
12+
| 'user-profile'
13+
| 'google-one-tap'
14+
| 'waitlist';
615
}
716
817
import { generateSafeId } from '@clerk/astro/internal';
918
10-
const { component, id, ...props } = Astro.props
19+
const { component, id, ...props } = Astro.props;
1120
1221
const safeId = id || generateSafeId();
1322
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
import type { WaitlistProps } from "@clerk/types";
3+
type Props = WaitlistProps
4+
5+
import InternalUIComponentRenderer from './InternalUIComponentRenderer.astro'
6+
---
7+
8+
<InternalUIComponentRenderer {...Astro.props} component="waitlist" />

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const mountAllClerkAstroJSComponents = () => {
1313
'sign-in': 'mountSignIn',
1414
'sign-up': 'mountSignUp',
1515
'google-one-tap': 'openGoogleOneTap',
16+
waitlist: 'mountWaitlist',
1617
} as const;
1718

1819
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
@@ -7,6 +7,7 @@ import type {
77
SignUpProps,
88
UserButtonProps,
99
UserProfileProps,
10+
WaitlistProps,
1011
} from '@clerk/types';
1112
import React from 'react';
1213

@@ -174,3 +175,13 @@ export const GoogleOneTap = withClerk(({ clerk, ...props }: WithClerkProp<Google
174175
/>
175176
);
176177
}, 'GoogleOneTap');
178+
179+
export const Waitlist = withClerk(({ clerk, ...props }: WithClerkProp<WaitlistProps>) => {
180+
return (
181+
<Portal
182+
mount={clerk?.mountWaitlist}
183+
unmount={clerk?.unmountWaitlist}
184+
props={props}
185+
/>
186+
);
187+
}, 'Waitlist');

0 commit comments

Comments
 (0)