fix(web): move reset password to after sign in (#2205)

This is for a better user experience, specifically it makes it so when users tab through the elements in the login form they are selected in a logical order.

Fixes #2204
pull/2212/head^2
James Elliott 2021-07-30 09:29:57 +10:00 committed by GitHub
parent c98b2a7d59
commit e77f79853a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 52 deletions

View File

@ -139,17 +139,8 @@ const FirstFactorForm = function (props: Props) {
}} }}
/> />
</Grid> </Grid>
{props.rememberMe || props.resetPassword ? (
<Grid
item
xs={12}
className={
props.rememberMe
? classnames(style.leftAlign, style.actionRow)
: classnames(style.leftAlign, style.flexEnd, style.actionRow)
}
>
{props.rememberMe ? ( {props.rememberMe ? (
<Grid item xs={12} className={classnames(style.actionRow)}>
<FormControlLabel <FormControlLabel
control={ control={
<Checkbox <Checkbox
@ -174,17 +165,6 @@ const FirstFactorForm = function (props: Props) {
className={style.rememberMe} className={style.rememberMe}
label="Remember me" label="Remember me"
/> />
) : null}
{props.resetPassword ? (
<Link
id="reset-password-button"
component="button"
onClick={handleResetPasswordClick}
className={style.resetLink}
>
Reset password?
</Link>
) : null}
</Grid> </Grid>
) : null} ) : null}
<Grid item xs={12}> <Grid item xs={12}>
@ -199,6 +179,18 @@ const FirstFactorForm = function (props: Props) {
Sign in Sign in
</Button> </Button>
</Grid> </Grid>
{props.resetPassword ? (
<Grid item xs={12} className={classnames(style.actionRow, style.flexEnd)}>
<Link
id="reset-password-button"
component="button"
onClick={handleResetPasswordClick}
className={style.resetLink}
>
Reset password?
</Link>
</Grid>
) : null}
</Grid> </Grid>
</LoginLayout> </LoginLayout>
); );
@ -224,11 +216,4 @@ const useStyles = makeStyles((theme) => ({
flexEnd: { flexEnd: {
justifyContent: "flex-end", justifyContent: "flex-end",
}, },
leftAlign: {
textAlign: "left",
},
rightAlign: {
textAlign: "right",
verticalAlign: "bottom",
},
})); }));