Handle inactive/no-building view/edit combinations
This commit is contained in:
parent
b1941ae358
commit
bc53605f3f
@ -213,7 +213,7 @@ const withCopyEdit = (WrappedComponent) => {
|
|||||||
onSubmit={this.handleSubmit}>
|
onSubmit={this.handleSubmit}>
|
||||||
<ErrorBox msg={this.state.error} />
|
<ErrorBox msg={this.state.error} />
|
||||||
{
|
{
|
||||||
(this.props.mode === 'edit' && this.props.inactive) ?
|
(this.props.inactive) ?
|
||||||
<InfoBox
|
<InfoBox
|
||||||
msg={`We're not collecting data on ${this.props.title.toLowerCase()} yet - check back soon.`}
|
msg={`We're not collecting data on ${this.props.title.toLowerCase()} yet - check back soon.`}
|
||||||
/>
|
/>
|
||||||
@ -247,7 +247,29 @@ const withCopyEdit = (WrappedComponent) => {
|
|||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
</form>
|
</form>
|
||||||
: <InfoBox msg="Select a building to view data"></InfoBox>
|
:
|
||||||
|
<form>
|
||||||
|
{
|
||||||
|
(this.props.inactive)?
|
||||||
|
<Fragment>
|
||||||
|
<InfoBox
|
||||||
|
msg={`We're not collecting data on ${this.props.title.toLowerCase()} yet - check back soon.`}
|
||||||
|
/>
|
||||||
|
<WrappedComponent
|
||||||
|
building={undefined}
|
||||||
|
building_like={undefined}
|
||||||
|
mode={this.props.mode}
|
||||||
|
copy={copy}
|
||||||
|
onChange={this.handleChange}
|
||||||
|
onCheck={this.handleCheck}
|
||||||
|
onLike={this.handleLike}
|
||||||
|
onUpdate={this.handleUpdate}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
:
|
||||||
|
<InfoBox msg="Select a building to view data"></InfoBox>
|
||||||
|
}
|
||||||
|
</form>
|
||||||
}
|
}
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user