forked from jimmy-byte/Hacktoberfest2023-codeshell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Drawer.jsx
142 lines (136 loc) · 4.46 KB
/
Drawer.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import { PlusOutlined } from '@ant-design/icons';
import { Button, Col, DatePicker, Drawer, Form, Input, Row, Select, Space } from 'antd';
import React, { useState } from 'react';
const { Option } = Select;
const App: React.FC = () => {
const [open, setOpen] = useState(false);
const showDrawer = () => {
setOpen(true);
};
const onClose = () => {
setOpen(false);
};
return (
<>
<Button type="primary" onClick={showDrawer} icon={<PlusOutlined />}>
New account
</Button>
<Drawer
title="Create a new account"
width={740}
onClose={onClose}
open={open}
bodyStyle={{ paddingBottom: 90 }}
extra={
<Space>
<Button onClick={onClose}>Cancel</Button>
<Button onClick={onClose} type="primary">
Submit
</Button>
</Space>
}
>
<Form layout="vertical" hideRequiredMark>
<Row gutter={16}>
<Col span={12}>
<Form.Item
name="name"
label="Full Name"
rules={[{ required: true, message: 'Please enter user full name' }]}
>
<Input placeholder="Please enter user name" />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
name="url"
label="Web Url"
rules={[{ required: true, message: 'Please enter related url' }]}
>
<Input
style={{ width: '100%' }}
addonBefore="https://"
addonAfter=".org"
placeholder="Please enter valied url"
/>
</Form.Item>
</Col>
</Row>
<Row gutter={16}>
<Col span={12}>
<Form.Item
name="familyMemberName"
label="Family Member Name"
rules={[{ required: true, message: 'Please select Family Member Name' }]}
>
<Select placeholder="Please select Family Member Name">
<Option value="fam1">Fam 1</Option>
<Option value="mfam2ao">Fam 2</Option>
</Select>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
name="userType"
label="User Type"
rules={[{ required: true, message: 'Please choose the User Type' }]}
>
<Select placeholder="Please choose the type">
<Option value="private">Private</Option>
<Option value="public">Public</Option>
<Option value="govenment">Govenment</Option>
<Option value="international">International</Option>
</Select>
</Form.Item>
</Col>
</Row>
<Row gutter={16}>
<Col span={12}>
<Form.Item
name="mentor"
label="Mentor"
rules={[{ required: true, message: 'Please choose the Mentor' }]}
>
<Select placeholder="Please choose the approver">
<Option value="prof">Profesor</Option>
<Option value="lec">Lecture</Option>
<Option value="demo">Demo</Option>
<Option value="ind">Industrial</Option>
</Select>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
name="dateTimeValue"
label="DateTime"
rules={[{ required: true, message: 'Please choose the date and Time' }]}
>
<DatePicker.RangePicker
style={{ width: '100%' }}
getPopupContainer={trigger => trigger.parentElement!}
/>
</Form.Item>
</Col>
</Row>
<Row gutter={16}>
<Col span={24}>
<Form.Item
name="description"
label="Description"
rules={[
{
required: true,
message: 'please enter description',
},
]}
>
<Input.TextArea rows={6} placeholder="please enter description" />
</Form.Item>
</Col>
</Row>
</Form>
</Drawer>
</>
);
};
export default App;