1
|
import { Form, Input, Button } from 'antd';
|
2
|
import { UserOutlined, LockOutlined } from '@ant-design/icons';
|
3
|
import 'antd/dist/antd.css';
|
4
|
import LoginLayout from '../../layouts/loginLayout';
|
5
|
|
6
|
function Login() {
|
7
|
const onFinish = (values: any) => {
|
8
|
console.log('Values of the login form: ', values);
|
9
|
};
|
10
|
|
11
|
const onFinishFailed = (errorInfo: any) => {
|
12
|
console.log('Errors: ', errorInfo);
|
13
|
};
|
14
|
|
15
|
return (
|
16
|
<LoginLayout>
|
17
|
<Form
|
18
|
name="login"
|
19
|
onFinish={onFinish}
|
20
|
onFinishFailed={onFinishFailed}
|
21
|
autoComplete="off"
|
22
|
>
|
23
|
<Form.Item
|
24
|
name="email"
|
25
|
rules={[
|
26
|
{
|
27
|
required: true,
|
28
|
message: 'Prosím zadejte svůj email',
|
29
|
},
|
30
|
{
|
31
|
type: 'email',
|
32
|
message:
|
33
|
'Prosím zadejte svůj email ve formátu: "jmeno@example.com"',
|
34
|
},
|
35
|
]}
|
36
|
>
|
37
|
<Input
|
38
|
prefix={<UserOutlined className="site-form-item-icon" />}
|
39
|
placeholder="Email"
|
40
|
/>
|
41
|
</Form.Item>
|
42
|
|
43
|
<Form.Item
|
44
|
name="password"
|
45
|
rules={[{ required: true, message: 'Prosím zadejte své heslo' }]}
|
46
|
>
|
47
|
<Input.Password
|
48
|
prefix={<LockOutlined className="site-form-item-icon" />}
|
49
|
placeholder="Heslo"
|
50
|
/>
|
51
|
</Form.Item>
|
52
|
<Form.Item>
|
53
|
<Button type="primary" htmlType="submit">
|
54
|
Přihlásit
|
55
|
</Button>
|
56
|
</Form.Item>
|
57
|
</Form>
|
58
|
</LoginLayout>
|
59
|
);
|
60
|
}
|
61
|
|
62
|
export default Login;
|