Skip to content

Commit

Permalink
Add ability to CONTINUE the login form by pressing ENTER key (#740)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:

**Which issue(s) this PR fixes**:

Fixes #734

**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
-->
```release-note
NONE
```

This PR was merged by Kapetanios.
  • Loading branch information
cakecatz committed Sep 4, 2020
1 parent 7025b99 commit 47f175f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/app/web/src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export const LoginPage: FC = memo(function LoginPage() {
const projectName = useProjectName();
const [name, setName] = useState<string>("");

const handleOnContinue = (): void => {
const handleOnContinue = (e: React.FormEvent<HTMLFormElement>): void => {
e.preventDefault();
dispatch(setProjectName(name));
};

Expand All @@ -57,7 +58,7 @@ export const LoginPage: FC = memo(function LoginPage() {
{me && me.isLogin && <Redirect to={PAGE_PATH_APPLICATIONS} />}
<Card className={classes.content}>
{projectName === null ? (
<>
<form onSubmit={handleOnContinue}>
<Typography variant="h4">Sign in to your project</Typography>
<div className={classes.fields}>
<TextField
Expand All @@ -73,16 +74,16 @@ export const LoginPage: FC = memo(function LoginPage() {
</div>
<div className={classes.buttons}>
<Button
type="submit"
color="primary"
variant="contained"
endIcon={<ArrowRightAltIcon />}
onClick={handleOnContinue}
disabled={name === ""}
>
CONTINUE
</Button>
</div>
</>
</form>
) : (
<LoginForm />
)}
Expand Down

0 comments on commit 47f175f

Please sign in to comment.