-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSignUp.tsx
97 lines (90 loc) · 2.06 KB
/
SignUp.tsx
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
import { Button, Form, Input, Radio } from 'antd'
import React from 'react'
import { UserOutlined, LockOutlined } from '@ant-design/icons'
const SignUp = () => {
const [form] = Form.useForm()
const [orgType, setOrgType] = React.useState('');
const onFinish = (values: any) => {
console.log(values)
}
const onReset = () => {
form.resetFields()
}
return (
<Form form={form} name="control-hooks" onFinish={onFinish}>
<Form.Item>
<Radio.Group>
<Radio value="govt" onClick={() => {setOrgType('govt')}}> Government Organization </Radio>
<Radio value="pvt" onClick={() => {setOrgType('pvt')}}> Private Organization </Radio>
</Radio.Group>
</Form.Item>
{
orgType === 'govt' ?
<Form.Item>
<Input placeholder='Organization ID' size={"large"}/>
</Form.Item>
: null
}
<Form.Item name="email" rules={[{ required: true }]}>
<Input
size="large"
placeholder="Email"
style={{ marginTop: '4%' }}
prefix={
<UserOutlined
style={{
marginRight: '5px',
color: '#2697ff',
}}
/>
}
/>
</Form.Item>
<Form.Item name="password" rules={[{ required: true }]}>
<Input.Password
size="large"
placeholder="Password (6 characters atleast, case sensitive)"
prefix={
<LockOutlined
style={{
marginRight: '5px',
color: '#2697ff',
}}
/>
}
/>
</Form.Item>
<Form.Item name="confirm-password" rules={[{ required: true }]}>
<Input.Password
size="large"
placeholder="Confirm password"
prefix={
<LockOutlined
style={{
marginRight: '5px',
color: '#2697ff',
}}
/>
}
/>
</Form.Item>
<Form.Item>
<Button
type="primary"
htmlType="submit"
style={{ width: '6vw', marginRight: '3%', marginTop: '0.8rem' }}
>
Sign Up
</Button>
<Button
htmlType="button"
onClick={onReset}
style={{ width: '6vw', marginTop: '0.8rem' }}
>
Reset
</Button>
</Form.Item>
</Form>
)
}
export default SignUp