Skip to content

Commit

Permalink
fix(form): rename text to headerText in BaseFormProps
Browse files Browse the repository at this point in the history
  • Loading branch information
unleashit committed Feb 3, 2024
1 parent 13fcf5a commit d2f7aa2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/forgotPassword/src/forgotPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const varNames = [...varNamesCommonForm] as const;
export const ForgotPassword = ({
handler,
onSuccess,
title = 'Forgot Password',
headerText = 'Forgot Password',
header: Header = DefaultForgotPasswordHeader,
loader: Loader = DefaultLoader,
childrenPosition = 'bottom',
Expand Down Expand Up @@ -132,7 +132,7 @@ export const ForgotPassword = ({
<ShowSuccess successMessage={successMessage} clsName={clsName} />
) : (
<>
{Header && <Header title={title} clsName={clsName} />}
{Header && <Header title={headerText} clsName={clsName} />}
{errors.root && !toast && (
<div className={clsName('serverAuthError')}>
{errors.root.message}
Expand Down
4 changes: 2 additions & 2 deletions packages/forgotPassword/src/forgotPasswordReset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const varNames = [...varNamesCommonForm] as const;
export const ForgotPasswordReset = ({
handler,
onSuccess,
title = 'Reset Password',
headerText = 'Reset Password',
header: Header = DefaultForgotPasswordResetHeader,
loader: Loader = DefaultLoader,
childrenPosition = 'bottom',
Expand Down Expand Up @@ -125,7 +125,7 @@ export const ForgotPasswordReset = ({
<ShowSuccess successMessage={successMessage} clsName={clsName} />
) : (
<>
{Header && <Header title={title} clsName={clsName} />}
{Header && <Header title={headerText} clsName={clsName} />}
{errors.root && !toast && (
<div className={clsName('serverAuthError')}>
{errors.root.message}
Expand Down
4 changes: 2 additions & 2 deletions packages/login/src/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const varNames = [
export const Login = ({
handler,
onSuccess,
title = 'Login',
headerText = 'Login',
signupUrl = '/signup',
header: Header = DefaultLoginHeader,
loader: Loader = DefaultLoader,
Expand Down Expand Up @@ -141,7 +141,7 @@ export const Login = ({
<>
{Header && (
<Header
title={title}
title={headerText}
signupUrl={signupUrl}
linkComponent={LinkComponent}
linkComponentHrefAttr={linkComponentHrefAttr}
Expand Down
4 changes: 2 additions & 2 deletions packages/quickForm/src/quickForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const varNames = [...varNamesCommonForm] as const;
function QuickForm({
handler,
onSuccess,
title = 'Contact Us',
headerText = 'Contact Us',
header: Header = DefaultHeader,
footer: Footer,
loader: Loader = DefaultLoader,
Expand Down Expand Up @@ -139,7 +139,7 @@ function QuickForm({
<ShowSuccess successMessage={successMessage} clsName={clsName} />
) : (
<>
{!!Header && <Header title={title} clsName={clsName} />}
{!!Header && <Header title={headerText} clsName={clsName} />}
{errors.root && !toast && (
<div className={clsName('serverAuthError')}>
{errors.root.message}
Expand Down
4 changes: 2 additions & 2 deletions packages/signup/src/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const varNames = [
export const Signup = ({
handler,
onSuccess,
title = 'Signup',
headerText = 'Signup',
header: Header = DefaultSignupHeader,
loader: Loader = DefaultLoader,
orLine = true,
Expand Down Expand Up @@ -143,7 +143,7 @@ export const Signup = ({
<>
{Header && (
<Header
title={title}
title={headerText}
loginUrl={loginUrl}
linkComponent={LinkComponent}
linkComponentHrefAttr={linkComponentHrefAttr}
Expand Down
2 changes: 1 addition & 1 deletion shared/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type BaseFormProps = {
onSuccess?: <T extends ZodTypeAny, Meta extends Record<string, any>>(
resp: ServerResponse<FormValues<T>, Meta>,
) => void;
title?: string;
headerText?: string;
header?: React.FC<DefaultHeaderProps> | false | null;
footer?: React.FC<any>;
loader?: React.FC<DefaultLoaderProps>;
Expand Down

0 comments on commit d2f7aa2

Please sign in to comment.