Skip to content

Commit

Permalink
disabled login button when no email or password is provided and add t…
Browse files Browse the repository at this point in the history
…est ids
  • Loading branch information
adamszeptycki committed Sep 4, 2019
1 parent b113388 commit f6f7554
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/LoginScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ const LoginScreen: React.FunctionComponent<ILoginScreenProps> = ({
<form className={classes.inputWrapperStyle}>
<TextField
type="email"
inputProps={{
"data-testId":"email"
}}
autoComplete="email"
className={`${classes.inputField} ${classes.emailInputField}`}
label={emailLabel}
Expand All @@ -130,6 +133,9 @@ const LoginScreen: React.FunctionComponent<ILoginScreenProps> = ({
<FormControl className={`${classes.inputField} ${classes.passwordInputField}`}>
<InputLabel htmlFor="adornment-password">Password</InputLabel>
<Input
inputProps={{
"data-testId":"password"
}}
type={inputFields.showPassword ? 'text' : 'password'}
autoComplete="password"
{...passwordTextFieldProps}
Expand All @@ -149,7 +155,7 @@ const LoginScreen: React.FunctionComponent<ILoginScreenProps> = ({
</form>
</div>
</div>
<Button className={classes.submitButton} onClick={onSubmitClick} {...submitButtonProps}>
<Button disabled={!inputFields.email || !inputFields.password } className={classes.submitButton} onClick={onSubmitClick} {...submitButtonProps}>
Submit
</Button>
</Card>
Expand Down

0 comments on commit f6f7554

Please sign in to comment.