-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathLoginForm.jsx
64 lines (60 loc) · 1.66 KB
/
LoginForm.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import React from 'react';
import { Form, Input, Checkbox } from 'antd';
import { UserOutlined, LockOutlined } from '@ant-design/icons';
import useLanguage from '@/locale/useLanguage';
import { useSelector } from 'react-redux';
import { selectLangDirection } from '@/redux/translate/selectors';
export default function LoginForm({ form }) {
const langDirection = useSelector(selectLangDirection);
const translate = useLanguage();
return (
<div style={{ direction: langDirection }}>
<Form.Item
label={translate('email')}
name="email"
rules={[
{
required: true,
},
{
type: 'email',
},
]}
>
<Input
prefix={<UserOutlined className="site-form-item-icon" />}
placeholder={translate('email')}
type="email"
size="large"
/>
</Form.Item>
<Form.Item
label={translate('password')}
name="password"
rules={[
{
required: true,
},
]}
>
<Input.Password
prefix={<LockOutlined className="site-form-item-icon" />}
placeholder={translate('password')}
size="large"
/>
</Form.Item>
<Form.Item>
<Form.Item name="remember" valuePropName="checked" noStyle>
<Checkbox>{translate('Remember me')}</Checkbox>
</Form.Item>
<a
className="login-form-forgot"
href="/forgetpassword"
style={{ marginLeft: langDirection === 'rtl' ? '220px' : '0px' }}
>
{translate('Forgot password')}
</a>
</Form.Item>
</div>
);
}