-
Notifications
You must be signed in to change notification settings - Fork 0
/
trash
187 lines (179 loc) · 6.17 KB
/
trash
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
import React, { useState } from "react";
const AddEmployee = () => {
const [employee, setEmployee] = useState({
firstName: "",
lastName: "",
emailAddress: "",
phoneNumber: "",
education: {
college: "",
ranks: "",
score: "",
},
employeeCode: "",
jobTitleName: "",
});
const {
firstName,
lastName,
emailAddress,
phoneNumber,
education: { ranks, score },
employeeCode,
jobTitleName,
} = employee;
const onInputChange = (e) => {
setEmployee({
...employee,
[e.target.name]: e.target.value,
});
};
const onChangeEducation = (e) => {
setEmployee({...employee, education: { college: e.target.value } });
};
return (
<section className="addEmployee">
<div className="container">
<div className="row">
<div className="col-md-10 m-auto">
<div className="card card-body shadow border-0 p-4">
<h2 className="text-center my-3">Add New Employee</h2>
<form>
{/* personal information */}
<div className="mb-5">
<p className="h4">Personal Information</p>
<hr />
<div className="form-group">
<label>Firstname</label>
<input
type="text"
className="form-control"
name="firstName"
value={firstName}
onChange={(e) => onInputChange(e)}
/>
</div>
<div className="form-group">
<label>Lastname</label>
<input
type="text"
className="form-control"
name="lastName"
value={lastName}
onChange={(e) => onInputChange(e)}
/>
</div>
<div className="form-group">
<label>Email Address</label>
<input
type="email"
className="form-control"
name="emailAddress"
value={emailAddress}
onChange={(e) => onInputChange(e)}
/>
</div>
<div className="form-group">
<label>Contact number</label>
<input
type="text"
className="form-control"
name="phoneNumber"
value={phoneNumber}
onChange={(e) => onInputChange(e)}
/>
</div>
</div>
{/* Education */}
<div className="mb-5">
<p className="h4">Education</p>
<hr />
<div className="form-group">
<label>College</label>
<input
type="text"
className="form-control"
name="college"
value={employee.education.college}
onChange={(e) => onChangeEducation(e)}
/>
</div>
<div className="form-group">
<label>Rank</label>
<input
type="text"
className="form-control"
name="ranks"
value={ranks}
onChange={(e) => onInputChange(e)}
/>
</div>
<div className="form-group">
<label>Score</label>
<input
type="text"
className="form-control"
name="score"
value={score}
onChange={(e) => onInputChange(e)}
/>
</div>
</div>
{/* Job */}
<div className="mb-5">
<p className="h4">Job Description</p>
<hr />
<div className="form-group">
<label>Employee ID</label>
<input
type="text"
className="form-control"
name="employeeCode"
value={employeeCode}
onChange={(e) => onInputChange(e)}
/>
</div>
<div className="form-group">
<label>Job Title</label>
<select
className="custom-select"
name="jobTitleName"
value={jobTitleName}
onChange={(e) => onInputChange(e)}
>
<option value="Developer">Developer</option>
<option value="Designer">Designer</option>
<option value="Tester">Tester</option>
</select>
</div>
<div className="form-group">
<label>Skills</label>
{/* {this.state.skills.map((skill, index) => {
return (
<div className="row my-2" key={index}>
<div className="col-md-8">
<input className="form-control" />
</div>
<div className="col-md-2">
<button className="btn btn-danger" type="button">
X
</button>
</div>
</div>
);
})} */}
</div>
<button className="btn btn-success btn-sm" type="button">
Add skills
</button>
</div>
<button className="btn btn-primary">Save</button>
</form>
</div>
</div>
</div>
</div>
</section>
);
};
export default AddEmployee;