Skip to content

Commit

Permalink
Clean types
Browse files Browse the repository at this point in the history
  • Loading branch information
amitbadala committed Oct 25, 2023
1 parent 8d60068 commit 809d396
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions lib/ts/recipe/emailpassword/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export type NormalisedSignUpFormFeatureConfig = NormalisedBaseConfig & {
/*
* Normalised form fields for SignUp.
*/
formFields: NormalisedFormField[];
formFields: (NormalisedFormField & { inputComponent?: React.FC<InputProps> })[];

/*
* Privacy policy link for sign up form.
Expand Down Expand Up @@ -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<FormFieldThemeProps, "inputComponent">[];

error: string | undefined;
};

export type SignInThemeProps = SignInFormThemeBaseProps & {
export type SignInThemeProps = FormThemeBaseProps & {
recipeImplementation: RecipeInterface;
clearError: () => void;
onError: (error: string) => void;
Expand All @@ -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 = {
Expand Down

0 comments on commit 809d396

Please sign in to comment.