Skip to content

Commit

Permalink
Merge pull request #249 from comicrelief/248_pclu_hide_logic_update
Browse files Browse the repository at this point in the history
New PCLU hide logic, PL update
  • Loading branch information
AndyEPhipps authored Sep 24, 2018
2 parents 5de2d47 + 514cd44 commit 3b5f3ee
Show file tree
Hide file tree
Showing 2 changed files with 593 additions and 608 deletions.
57 changes: 27 additions & 30 deletions src/components/PostcodeLookup/PostcodeLookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,40 +398,37 @@ class PostcodeLookup extends Component {
<span className="form-error">Please fill in your address</span>
</div>
}
{
this.state.isAddressFieldsHidden === false &&
<div>
{ addressOuptutFields.map(item => (
<InputField
key={item.id}
ref={this.setRefs}
id={item.id}
type={item.type}
name={item.id}
label={item.label}
required={item.required}
value={id => this.addressValue(id)}
pattern={item.pattern}
invalidErrorText={item.invalidErrorText}
showErrorMessage={this.state.showErrorMessages}
fieldValue={this.props.valuesFromParent}
isValid={(valid, name) => { this.setValidity(name, valid); }}
/>
))
}
<SelectField
<div className={this.state.isAddressFieldsHidden === false ? '' : 'hide'}>
{addressOuptutFields.map(item => (
<InputField
key={item.id}
ref={this.setRefs}
id="country"
name="country"
label="Country"
required
options={this.state.countryDropdownList}
value={() => this.state.validation.country.value}
id={item.id}
type={item.type}
name={item.id}
label={item.label}
required={item.required}
value={id => this.addressValue(id)}
pattern={item.pattern}
invalidErrorText={item.invalidErrorText}
showErrorMessage={this.state.showErrorMessages}
fieldValue={this.props.valuesFromParent}
isValid={(valid, name) => { this.setValidity(name, valid); }}
/>
</div>
}
))
}
<SelectField
ref={this.setRefs}
id="country"
name="country"
label="Country"
required
options={this.state.countryDropdownList}
value={() => this.state.validation.country.value}
showErrorMessage={this.state.showErrorMessages}
isValid={(valid, name) => { this.setValidity(name, valid); }}
/>
</div>
</div>
</div>
);
Expand Down
Loading

0 comments on commit 3b5f3ee

Please sign in to comment.