always show metadata inputs on update

This commit is contained in:
Travis Eden 2018-10-16 11:56:17 -04:00
parent 5747245e64
commit 41cc6f5118
2 changed files with 11 additions and 7 deletions

View file

@ -8,6 +8,7 @@ const mapStateToProps = ({ publish }) => {
description : publish.metadata.description, description : publish.metadata.description,
license : publish.metadata.license, license : publish.metadata.license,
nsfw : publish.metadata.nsfw, nsfw : publish.metadata.nsfw,
isUpdate : publish.isUpdate,
}; };
}; };

View file

@ -26,27 +26,30 @@ class PublishMetadataInputs extends React.Component {
this.props.onMetadataChange(name, selectedOption); this.props.onMetadataChange(name, selectedOption);
} }
render () { render () {
const { showMetadataInputs, description, isUpdate, nsfw } = this.props;
return ( return (
<div> <div>
{this.props.showMetadataInputs && ( {(showMetadataInputs || isUpdate) && (
<div> <div>
<PublishDescriptionInput <PublishDescriptionInput
description={this.props.description} description={description}
handleInput={this.handleInput} handleInput={this.handleInput}
/> />
<PublishLicenseInput <PublishLicenseInput
handleSelect={this.handleSelect} handleSelect={this.handleSelect}
/> />
<PublishNsfwInput <PublishNsfwInput
nsfw={this.props.nsfw} nsfw={nsfw}
handleInput={this.handleInput} handleInput={this.handleInput}
/> />
</div> </div>
)} )}
{!isUpdate && (
<ButtonSecondary <ButtonSecondary
value={this.props.showMetadataInputs ? 'less' : 'more'} value={showMetadataInputs ? 'less' : 'more'}
onClickHandler={this.toggleShowInputs} onClickHandler={this.toggleShowInputs}
/> />
)}
</div> </div>
); );
} }