From c8b31dbbfb821597380ff62db3988fa005efbb97 Mon Sep 17 00:00:00 2001 From: amitbadala Date: Tue, 24 Oct 2023 18:33:22 +0530 Subject: [PATCH] Move inputComponent to signup types --- lib/build/recipe/emailpassword/types.d.ts | 8 ++++++-- lib/build/types.d.ts | 1 - lib/ts/recipe/emailpassword/types.ts | 13 +++++++------ lib/ts/types.ts | 5 ----- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/build/recipe/emailpassword/types.d.ts b/lib/build/recipe/emailpassword/types.d.ts index d819f58c8..1c9da91cf 100644 --- a/lib/build/recipe/emailpassword/types.d.ts +++ b/lib/build/recipe/emailpassword/types.d.ts @@ -94,7 +94,9 @@ export declare type NormalisedSignInFormFeatureConfig = NormalisedBaseConfig & { formFields: NormalisedFormField[]; }; export declare type FormFieldSignInConfig = FormFieldBaseConfig; -export declare type FormFieldSignUpConfig = FormField; +export declare type FormFieldSignUpConfig = FormField & { + inputComponent?: React.FC; +}; export declare type ResetPasswordUsingTokenUserInput = { disableDefaultUI?: boolean; submitNewPasswordForm?: FeatureBaseConfig; @@ -131,6 +133,9 @@ export declare type SignUpThemeProps = FormThemeBaseProps & { config: NormalisedConfig; signInClicked?: () => void; onSuccess: (result: { user: User }) => void; + formFields: (FormFieldThemeProps & { + inputComponent?: React.FC; + })[]; }; export declare type SignInAndUpThemeProps = { signInForm: SignInThemeProps; @@ -144,7 +149,6 @@ export declare type SignInAndUpThemeProps = { }; export declare type FormFieldThemeProps = NormalisedFormField & { labelComponent?: JSX.Element; - inputComponent?: React.FC; showIsRequired?: boolean; clearOnSubmit?: boolean; }; diff --git a/lib/build/types.d.ts b/lib/build/types.d.ts index 223b152bf..3c70442b9 100644 --- a/lib/build/types.d.ts +++ b/lib/build/types.d.ts @@ -94,7 +94,6 @@ export declare type FormFieldBaseConfig = { export declare type FormField = FormFieldBaseConfig & { validate?: (value: any) => Promise; optional?: boolean; - inputComponent?: React.FC; }; export declare type APIFormField = { id: string; diff --git a/lib/ts/recipe/emailpassword/types.ts b/lib/ts/recipe/emailpassword/types.ts index 253329077..274fa30b2 100644 --- a/lib/ts/recipe/emailpassword/types.ts +++ b/lib/ts/recipe/emailpassword/types.ts @@ -181,7 +181,12 @@ export type NormalisedSignInFormFeatureConfig = NormalisedBaseConfig & { export type FormFieldSignInConfig = FormFieldBaseConfig; -export type FormFieldSignUpConfig = FormField; +export type FormFieldSignUpConfig = FormField & { + /* + * Ability to add custom components + */ + inputComponent?: React.FC; +}; export type ResetPasswordUsingTokenUserInput = { /* @@ -255,6 +260,7 @@ export type SignUpThemeProps = FormThemeBaseProps & { config: NormalisedConfig; signInClicked?: () => void; onSuccess: (result: { user: User }) => void; + formFields: (FormFieldThemeProps & { inputComponent?: React.FC })[]; }; export type SignInAndUpThemeProps = { @@ -274,11 +280,6 @@ export type FormFieldThemeProps = NormalisedFormField & { */ labelComponent?: JSX.Element; - /* - * Custom component that replaces the standard input component - */ - inputComponent?: React.FC; - /* * Show Is required (*) next to label */ diff --git a/lib/ts/types.ts b/lib/ts/types.ts index 5785bdf77..595b24315 100644 --- a/lib/ts/types.ts +++ b/lib/ts/types.ts @@ -235,11 +235,6 @@ export type FormField = FormFieldBaseConfig & { * Whether the field is optional or not. */ optional?: boolean; - - /* - * Ability to add custom components - */ - inputComponent?: React.FC; }; export type APIFormField = {