Skip to content

Instantly share code, notes, and snippets.

@alexismansilla
Created September 22, 2021 03:19
Show Gist options
  • Save alexismansilla/a9f7ab7b91f1b299ce5da79dc340ef9e to your computer and use it in GitHub Desktop.
Save alexismansilla/a9f7ab7b91f1b299ce5da79dc340ef9e to your computer and use it in GitHub Desktop.
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