From 809d396734d896e295badfaa1cfb3c6b794330ed Mon Sep 17 00:00:00 2001 From: amitbadala Date: Wed, 25 Oct 2023 13:54:32 +0530 Subject: [PATCH] Clean types --- lib/ts/recipe/emailpassword/types.ts | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/lib/ts/recipe/emailpassword/types.ts b/lib/ts/recipe/emailpassword/types.ts index 432008bb7..a34397de0 100644 --- a/lib/ts/recipe/emailpassword/types.ts +++ b/lib/ts/recipe/emailpassword/types.ts @@ -152,7 +152,7 @@ export type NormalisedSignUpFormFeatureConfig = NormalisedBaseConfig & { /* * Normalised form fields for SignUp. */ - formFields: NormalisedFormField[]; + formFields: (NormalisedFormField & { inputComponent?: React.FC })[]; /* * Privacy policy link for sign up form. @@ -230,29 +230,16 @@ export type NormalisedEnterEmailForm = FeatureBaseConfig & { formFields: NormalisedFormField[]; }; -/* - * Props Types. - */ - type FormThemeBaseProps = ThemeBaseProps & { /* * Form fields to use in the signup form. */ - formFields: FormFieldThemeProps[]; - - error: string | undefined; -}; - -type SignInFormThemeBaseProps = ThemeBaseProps & { - /* - * Form fields to use in the signin form. exclude custom component - */ formFields: Omit[]; error: string | undefined; }; -export type SignInThemeProps = SignInFormThemeBaseProps & { +export type SignInThemeProps = FormThemeBaseProps & { recipeImplementation: RecipeInterface; clearError: () => void; onError: (error: string) => void; @@ -262,13 +249,15 @@ export type SignInThemeProps = SignInFormThemeBaseProps & { onSuccess: (result: { user: User }) => void; }; -export type SignUpThemeProps = FormThemeBaseProps & { +export type SignUpThemeProps = ThemeBaseProps & { recipeImplementation: RecipeInterface; clearError: () => void; onError: (error: string) => void; config: NormalisedConfig; signInClicked?: () => void; onSuccess: (result: { user: User }) => void; + formFields: FormFieldThemeProps[]; + error: string | undefined; }; export type SignInAndUpThemeProps = {