fix two factor layout issue

This commit is contained in:
Abhinav 2022-06-29 13:16:08 +05:30
parent dc3ca6a042
commit a259ab5f99
2 changed files with 37 additions and 32 deletions

View file

@ -50,11 +50,12 @@ export default function VerifyTwoFactor(props: Props) {
validateOnBlur={false} validateOnBlur={false}
onSubmit={submitForm}> onSubmit={submitForm}>
{({ values, errors, handleChange, handleSubmit, submitForm }) => ( {({ values, errors, handleChange, handleSubmit, submitForm }) => (
<form <VerticallyCentered>
noValidate <form noValidate onSubmit={handleSubmit}>
onSubmit={handleSubmit} <Typography
style={{ width: '100%' }}> mb={2}
<Typography mb={2} variant="body2" color="text.secondary"> variant="body2"
color="text.secondary">
{constants.ENTER_TWO_FACTOR_OTP} {constants.ENTER_TWO_FACTOR_OTP}
</Typography> </Typography>
<Box my={2}> <Box my={2}>
@ -62,7 +63,10 @@ export default function VerifyTwoFactor(props: Props) {
ref={otpInputRef} ref={otpInputRef}
shouldAutoFocus shouldAutoFocus
value={values.otp} value={values.otp}
onChange={onChange(handleChange('otp'), submitForm)} onChange={onChange(
handleChange('otp'),
submitForm
)}
numInputs={6} numInputs={6}
separator={'-'} separator={'-'}
isInputNum isInputNum
@ -82,6 +86,7 @@ export default function VerifyTwoFactor(props: Props) {
disabled={values.otp.length < 6} disabled={values.otp.length < 6}
/> />
</form> </form>
</VerticallyCentered>
)} )}
</Formik> </Formik>
); );

View file

@ -55,7 +55,7 @@ export default function Home() {
}; };
return ( return (
<FormContainer> <FormContainer>
<FormPaper sx={{ maxWidth: '400px' }}> <FormPaper sx={{ maxWidth: '410px' }}>
<FormTitle>{constants.TWO_FACTOR}</FormTitle> <FormTitle>{constants.TWO_FACTOR}</FormTitle>
<VerifyTwoFactor <VerifyTwoFactor
onSubmit={onSubmit} onSubmit={onSubmit}