Created
September 22, 2021 03:19
-
-
Save alexismansilla/a9f7ab7b91f1b299ce5da79dc340ef9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return ( | |
<Form form={form} name="horizontal_login" layout="inline" onFinish={onFinish}> | |
<Form.Item | |
name="username" | |
rules={[{ required: true, message: 'Please input your username!' }]} | |
> | |
<Input prefix={<UserOutlined className="site-form-item-icon" />} placeholder="Username" /> | |
</Form.Item> | |
<Form.Item | |
name="password" | |
rules={[{ required: true, message: 'Please input your password!' }]} | |
> | |
<Input | |
prefix={<LockOutlined className="site-form-item-icon" />} | |
type="password" | |
placeholder="Password" | |
/> | |
</Form.Item> | |
<Form.Item shouldUpdate> | |
{() => ( | |
<Button | |
type="primary" | |
htmlType="submit" | |
disabled={ | |
!form.isFieldsTouched(true) || | |
!!form.getFieldsError().filter(({ errors }) => errors.length).length | |
} | |
> | |
Log in | |
</Button> | |
)} | |
</Form.Item> | |
</Form> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment