Skip to content

Commit 3c0e838

Browse files
Minor changes (#198)
1 parent 9735b97 commit 3c0e838

File tree

2 files changed

+10
-56
lines changed

2 files changed

+10
-56
lines changed

Diff for: src/components/JAF/JobDetails.tsx

+10-55
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const JobDetails = ({ errors, values, handleChange, setFieldValue }: StepProps)
4545
const [form] = Form.useForm();
4646

4747
const [skills, setSkills] = useState([]);
48-
const [skillInput, setSkillInput] = useState("");
4948
const [fileList, setFileList] = useState([]);
5049

5150
const [testType, setTestType] = useState([]);
@@ -58,10 +57,6 @@ const JobDetails = ({ errors, values, handleChange, setFieldValue }: StepProps)
5857

5958
const baseUrl = process.env.NEXT_PUBLIC_BACKEND_URL;
6059

61-
const handleSkillChange = (e) => {
62-
setSkillInput(e.target.value);
63-
};
64-
6560
const handleFileChange = async (info: any) => {
6661
if (info.file.status !== 'uploading') {
6762
console.log('Uploading:', info.file, info.fileList);
@@ -83,22 +78,12 @@ const JobDetails = ({ errors, values, handleChange, setFieldValue }: StepProps)
8378
}
8479

8580
setFileList(info.fileList);
86-
};
87-
88-
const addSkill = () => {
89-
if (skillInput) {
90-
const updatedSkills = [...skills, skillInput];
91-
setSkills(updatedSkills);
92-
setSkillInput("");
93-
setFieldValue("skills", updatedSkills);
94-
}
95-
};
81+
};
9682

97-
const removeSkill = (skillToRemove) => {
98-
const updatedSkills = skills.filter((skill) => skill !== skillToRemove);
99-
setSkills(updatedSkills);
100-
setFieldValue("skills", updatedSkills);
101-
};
83+
const handleSkillChange = (newSkills: string[]) => {
84+
setSkills(newSkills);
85+
setFieldValue("skills", newSkills);
86+
}
10287

10388
useEffect(() => {
10489
axios.get(`${baseUrl}/api/v1/jaf`).then((res) => {
@@ -275,38 +260,14 @@ const JobDetails = ({ errors, values, handleChange, setFieldValue }: StepProps)
275260
<Row gutter={24}>
276261
<Col span={24}>
277262
<Form.Item label="Skills">
278-
<Input
279-
name="skills"
280-
placeholder="Enter a skill"
281-
value={skillInput}
263+
<Select
264+
mode="tags"
265+
style={{ width: "100%" }}
266+
placeholder="Enter a skill and press Enter"
267+
value={skills}
282268
onChange={handleSkillChange}
283269
/>
284270
</Form.Item>
285-
<Button type="primary" onClick={addSkill}>
286-
Add Skill
287-
</Button>
288-
289-
<List
290-
header={<div>Skills</div>}
291-
bordered
292-
dataSource={skills}
293-
renderItem={(item) => (
294-
<List.Item
295-
actions={[
296-
<Button
297-
type="link"
298-
onClick={() => removeSkill(item)}
299-
style={{ color: "red" }}
300-
>
301-
Remove
302-
</Button>,
303-
]}
304-
>
305-
{item}
306-
</List.Item>
307-
)}
308-
style={{ marginTop: "20px" }}
309-
/>
310271
</Col>
311272
</Row>
312273
<Form.Item label="Description" className="my-3">
@@ -534,12 +495,6 @@ const JobDetails = ({ errors, values, handleChange, setFieldValue }: StepProps)
534495
/>
535496
}
536497
>
537-
<Form.Item
538-
label="Salary Period"
539-
name={[field.name, "salaryPeriod"]}
540-
>
541-
<Input placeholder="Salary Period" />
542-
</Form.Item>
543498
<h2 className="text-sm ">Criteria</h2>
544499
<Row gutter={24}>
545500
<Col span={12}>

Diff for: src/components/jobs/JobCard.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ const JobCard = ({ jobItem, type}: Props) => {
106106
{jobItem.attachments.map((attachment, index) => (
107107
<div className="mx-2 my-2 cursor-pointer" key={index} onClick={() => handleOpenJD(attachment)}>
108108
<Image src={"/portal/images/file.png"} alt="" width={150} height={150} />
109-
<div className="text-center text-blue-500 font-semibold cursor-pointer hover:text-blue-600">{`Attachment (${index})`}</div>
110109
</div>
111110
))}
112111
</div>

0 commit comments

Comments
 (0)