diff --git a/.changeset/rotten-ligers-move.md b/.changeset/rotten-ligers-move.md new file mode 100644 index 0000000000..6bd991c0c8 --- /dev/null +++ b/.changeset/rotten-ligers-move.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-react': patch +--- + +Introducing stricter types for custom pages for UserProfile and OrganizationProfile. diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts index ab4766e200..b13c8336bc 100644 --- a/packages/react/src/types.ts +++ b/packages/react/src/types.ts @@ -82,6 +82,7 @@ type ButtonProps = { }; export type SignInButtonProps = ButtonProps; + export interface SignUpButtonProps extends ButtonProps { unsafeMetadata?: SignUpUnsafeMetadata; } @@ -91,11 +92,19 @@ export type SignInWithMetamaskButtonProps = Pick = + | { + label: string; + url: string; + labelIcon: React.ReactNode; + } + | { + label: T; + url?: never; + labelIcon?: never; + }; + +export type UserProfilePageProps = PageProps<'account' | 'security'>; export type UserProfileLinkProps = { url: string; @@ -103,5 +112,5 @@ export type UserProfileLinkProps = { labelIcon: React.ReactNode; }; -export type OrganizationProfilePageProps = UserProfilePageProps; +export type OrganizationProfilePageProps = PageProps<'general' | 'members'>; export type OrganizationProfileLinkProps = UserProfileLinkProps;