Skip to content

Commit

Permalink
made it so that pressing enter on signin and register page submits th…
Browse files Browse the repository at this point in the history
…e forms
  • Loading branch information
Sebbben committed Oct 11, 2024
1 parent 56dc570 commit cd922ac
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
37 changes: 20 additions & 17 deletions app/pages/auth/register/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,26 @@ export default function registerPage() {
}
}


const CheckedTextField = (title, textValue, textCallback) => {

return (
<Grid item>
<TextField
fullWidth
required
variant="filled"
label={title}
value={textValue}
onChange={(event) => textCallback(event.target.value)}
InputLabelProps={{ shrink: true }}
onKeyUp={(e)=>{if(e.key==="Enter") handleRegister()}}
/>
</Grid>
);

}

return (
<Box>
<Grid
Expand Down Expand Up @@ -165,23 +185,6 @@ export default function registerPage() {

}

const CheckedTextField = (title, textValue, textCallback) => {

return (
<Grid item>
<TextField
fullWidth
required
variant="filled"
label={title}
value={textValue}
onChange={(event) => textCallback(event.target.value)}
InputLabelProps={{ shrink: true }}
/>
</Grid>
);

}

//
async function checkUserExists(email, debug) {
Expand Down
1 change: 1 addition & 0 deletions app/pages/auth/signIn/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default function SignInPage() {
error={error}
onChange={(event) => setEmail(event.target.value)}
InputLabelProps={{ shrink: true }}
onKeyUp={(e) => {if(e.key==="Enter") handleLogin()}}
/>
</Grid>

Expand Down

0 comments on commit cd922ac

Please sign in to comment.