Skip to content

Commit c9f38e3

Browse files
committed
added dropdown state and removed second function to onchange
1 parent 31faf1f commit c9f38e3

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

src/Components/forms/inputs/index.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export default class VolunteerForm extends Component {
2828
guidePeople,
2929
techSkill,
3030
otherSkill,
31-
employer
31+
employer,
32+
displayDropdown
3233
} = this.props
3334

3435
return (
@@ -110,29 +111,25 @@ export default class VolunteerForm extends Component {
110111
isEmpty={errors.industry}
111112
label="What industry are you in?"
112113
/>
114+
113115
<DropDown
114-
onChange={
115-
(onChange,
116-
e => {
117-
return this.setState({
118-
displayDropdown: e.target.value === 'Employer'
119-
})
120-
})
121-
}
116+
onChange={onChange}
122117
value={hearAboutCYF}
123118
name="hearAboutCYF"
124119
arrayList={ListsData.hearAboutCYFList}
125120
isEmpty={errors.hearAboutCYF}
126121
label="Where did you hear about Code Your Future?"
127122
/>
128-
<DropDown
129-
onChange={onChange}
130-
value={employer}
131-
name="employer"
132-
arrayList={ListsData.employer}
133-
isEmpty={errors.employer}
134-
label="Who is your employer?"
135-
/>
123+
{displayDropdown && (
124+
<DropDown
125+
onChange={onChange}
126+
value={employer}
127+
name="employer"
128+
arrayList={ListsData.employer}
129+
isEmpty={errors.employer}
130+
label="Who is your employer?"
131+
/>
132+
)}
136133
<span className="contact-interested">
137134
<span>
138135
What would you like help Code Your Future with, and what is your

0 commit comments

Comments
 (0)