-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* otp bypass token * otp bypass token * fix: simplify page components * comment out unused lines * add router components * simplified text fields * clean up utils * rename to schema * fix import * fix import * fix import * create router utils * delete index * fix paths * fix props * do not set default value * comment out broken imports * comment out broken import * support helper text * fix auth factor type * add otp field * login path props * fix: hooks page auth flow * pass in session metadata * add placeholders * first name field * decode cookie value * add user type * set session user type * fix use session required * remove duplicate logic * fix imports * feedback
- Loading branch information
Showing
50 changed files
with
565 additions
and
751 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type { FC } from "react" | ||
import { string as YupString } from "yup" | ||
|
||
import TextField, { type TextFieldProps } from "./TextField" | ||
|
||
export type FirstNameFieldProps = Omit< | ||
TextFieldProps, | ||
"type" | "name" | "schema" | ||
> & | ||
Partial<Pick<TextFieldProps, "name">> | ||
|
||
const FirstNameField: FC<FirstNameFieldProps> = ({ | ||
name = "first_name", | ||
label = "First name", | ||
placeholder = "Enter your first name", | ||
...otherTextFieldProps | ||
}) => { | ||
return ( | ||
<TextField | ||
schema={YupString().max(150)} | ||
name={name} | ||
label={label} | ||
placeholder={placeholder} | ||
{...otherTextFieldProps} | ||
/> | ||
) | ||
} | ||
|
||
export default FirstNameField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
import { Stack, type StackProps } from "@mui/material" | ||
import { | ||
Formik, | ||
Form as FormikForm, | ||
type FormikConfig, | ||
type FormikErrors, | ||
type FormikValues, | ||
} from "formik" | ||
|
||
export interface FormProps<Values> extends FormikConfig<Values> { | ||
stackProps?: Omit<StackProps, "children"> | ||
} | ||
export interface FormProps<Values> extends FormikConfig<Values> {} | ||
|
||
const Form = <Values extends FormikValues = FormikValues>({ | ||
stackProps, | ||
children, | ||
...otherFormikProps | ||
}: FormProps<Values>): JSX.Element => { | ||
return ( | ||
<Formik {...otherFormikProps}> | ||
{formik => ( | ||
<FormikForm> | ||
<Stack {...stackProps}> | ||
{typeof children === "function" ? children(formik) : children} | ||
</Stack> | ||
{typeof children === "function" ? children(formik) : children} | ||
</FormikForm> | ||
)} | ||
</Formik> | ||
) | ||
} | ||
|
||
export default Form | ||
export { type FormikErrors as FormErrors } |
Oops, something went wrong.