Skip to content

Commit 08f5442

Browse files
committed
change the component name and remove unused props
1 parent dd1df32 commit 08f5442

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/Components/forms/inputs/AutoFillDropDown.js renamed to src/Components/forms/inputs/EmployerDropDown.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@ import React, { useState } from 'react'
22
import { Label } from 'reactstrap'
33
import '../index.css'
44

5-
const AutoFillDropDown = ({
6-
employerOnChange,
7-
isEmpty,
8-
label,
9-
name,
10-
arrayList
11-
}) => {
5+
const EmployerDropDown = ({ employerOnChange, isEmpty, arrayList }) => {
126
const [value, setValue] = useState('')
137
const filteredEmployers = arrayList.filter(item => {
148
const searchTerm = value.toLowerCase()
159
const employer = item.name.toLowerCase()
1610
const matchSearch = employer.includes(searchTerm)
17-
return searchTerm && matchSearch
11+
return searchTerm && matchSearch && employer !== searchTerm
1812
})
1913
const employerSorter = (a, b) => {
2014
const aIndex = a.name.toLowerCase().indexOf(value.toLowerCase())
@@ -28,11 +22,11 @@ const AutoFillDropDown = ({
2822
}
2923
return (
3024
<div className="form-group">
31-
<Label htmlFor={name}>{label}</Label>
25+
<Label htmlFor="employer">"Who is your employer?"</Label>
3226
<input
3327
className={`form-control ${isEmpty && 'is-empty'}`}
3428
type="text"
35-
id={name}
29+
id="employer"
3630
value={value}
3731
onChange={e => setValue(e.target.value)}
3832
placeholder="Type your employer name here"
@@ -57,4 +51,4 @@ const AutoFillDropDown = ({
5751
)
5852
}
5953

60-
export default AutoFillDropDown
54+
export default EmployerDropDown

0 commit comments

Comments
 (0)