From 0a88bcbfb950248d6364e7a3013ab3cb541428fa Mon Sep 17 00:00:00 2001 From: Elliot Hesp Date: Wed, 29 Oct 2025 14:37:08 +0000 Subject: [PATCH] fix(react,shadcn): Rename onRegisterClick -> onSignUpClick --- packages/react/src/auth/forms/sign-in-auth-form.test.tsx | 8 ++++---- packages/react/src/auth/forms/sign-in-auth-form.tsx | 8 ++++---- packages/shadcn/src/registry/sign-in-auth-form.test.tsx | 8 ++++---- packages/shadcn/src/registry/sign-in-auth-form.tsx | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/react/src/auth/forms/sign-in-auth-form.test.tsx b/packages/react/src/auth/forms/sign-in-auth-form.test.tsx index 1ccc731fc..43d7e0b68 100644 --- a/packages/react/src/auth/forms/sign-in-auth-form.test.tsx +++ b/packages/react/src/auth/forms/sign-in-auth-form.test.tsx @@ -229,7 +229,7 @@ describe("", () => { expect(onForgotPasswordClickMock).toHaveBeenCalled(); }); - it("should render the register button callback when onRegisterClick is provided", () => { + it("should render the register button callback when onSignUpClick is provided", () => { const mockUI = createMockUI({ locale: registerLocale("test", { prompts: { @@ -241,11 +241,11 @@ describe("", () => { }), }); - const onRegisterClickMock = vi.fn(); + const onSignUpClick = vi.fn(); render( - + ); @@ -259,7 +259,7 @@ describe("", () => { expect(registerButton).toHaveAttribute("type", "button"); fireEvent.click(registerButton); - expect(onRegisterClickMock).toHaveBeenCalled(); + expect(onSignUpClick).toHaveBeenCalled(); }); it("should trigger validation errors when the form is blurred", () => { diff --git a/packages/react/src/auth/forms/sign-in-auth-form.tsx b/packages/react/src/auth/forms/sign-in-auth-form.tsx index b592e88f6..e28d1cc12 100644 --- a/packages/react/src/auth/forms/sign-in-auth-form.tsx +++ b/packages/react/src/auth/forms/sign-in-auth-form.tsx @@ -26,7 +26,7 @@ import { useCallback } from "react"; export type SignInAuthFormProps = { onSignIn?: (credential: UserCredential) => void; onForgotPasswordClick?: () => void; - onRegisterClick?: () => void; + onSignUpClick?: () => void; }; export function useSignInAuthFormAction() { @@ -73,7 +73,7 @@ export function useSignInAuthForm(onSuccess?: SignInAuthFormProps["onSignIn"]) { }); } -export function SignInAuthForm({ onSignIn, onForgotPasswordClick, onRegisterClick }: SignInAuthFormProps) { +export function SignInAuthForm({ onSignIn, onForgotPasswordClick, onSignUpClick }: SignInAuthFormProps) { const ui = useUI(); const form = useSignInAuthForm(onSignIn); @@ -110,8 +110,8 @@ export function SignInAuthForm({ onSignIn, onForgotPasswordClick, onRegisterClic {getTranslation(ui, "labels", "signIn")} - {onRegisterClick ? ( - + {onSignUpClick ? ( + {getTranslation(ui, "prompts", "noAccount")} {getTranslation(ui, "labels", "register")} ) : null} diff --git a/packages/shadcn/src/registry/sign-in-auth-form.test.tsx b/packages/shadcn/src/registry/sign-in-auth-form.test.tsx index 1b7a4aa62..4d254a546 100644 --- a/packages/shadcn/src/registry/sign-in-auth-form.test.tsx +++ b/packages/shadcn/src/registry/sign-in-auth-form.test.tsx @@ -96,8 +96,8 @@ describe("", () => { expect(onForgotPasswordClickMock).toHaveBeenCalled(); }); - it("should render with register callback", () => { - const onRegisterClickMock = vi.fn(); + it("should render with onSignUp callback", () => { + const onSignUpClickMock = vi.fn(); const mockUI = createMockUI({ locale: registerLocale("test", { prompts: { @@ -111,7 +111,7 @@ describe("", () => { const { container } = render( - + ); @@ -123,7 +123,7 @@ describe("", () => { fireEvent.click(button!); }); - expect(onRegisterClickMock).toHaveBeenCalled(); + expect(onSignUpClickMock).toHaveBeenCalled(); }); it("should call the onSignIn callback when the form is submitted", async () => { diff --git a/packages/shadcn/src/registry/sign-in-auth-form.tsx b/packages/shadcn/src/registry/sign-in-auth-form.tsx index 93c2bef69..d07f010ec 100644 --- a/packages/shadcn/src/registry/sign-in-auth-form.tsx +++ b/packages/shadcn/src/registry/sign-in-auth-form.tsx @@ -77,9 +77,9 @@ export function SignInAuthForm(props: SignInAuthFormProps) { {getTranslation(ui, "labels", "signIn")} {form.formState.errors.root && {form.formState.errors.root.message}} - {props.onRegisterClick ? ( + {props.onSignUpClick ? ( <> -