Rename hasChanged to enableSave for the editor Save button.

This commit is contained in:
Caleb 2017-09-11 14:08:07 -06:00
parent 75aa52a650
commit 87f942e73b
3 changed files with 7 additions and 7 deletions

View File

@ -47,7 +47,7 @@ class EntryEditor extends Component {
fieldsErrors,
getAsset,
onChange,
hasChanged,
enableSave,
showDelete,
onDelete,
onValidate,
@ -132,7 +132,7 @@ class EntryEditor extends Component {
onCancelEdit={onCancelEdit}
onDelete={onDelete}
showDelete={showDelete}
hasChanged={hasChanged}
enableSave={enableSave}
/>
</div>
</div>
@ -151,7 +151,7 @@ EntryEditor.propTypes = {
onChange: PropTypes.func.isRequired,
onValidate: PropTypes.func.isRequired,
onPersist: PropTypes.func.isRequired,
hasChanged: PropTypes.bool.isRequired,
enableSave: PropTypes.bool.isRequired,
showDelete: PropTypes.bool.isRequired,
onDelete: PropTypes.func.isRequired,
onRemoveAsset: PropTypes.func.isRequired,

View File

@ -5,12 +5,12 @@ const EntryEditorToolbar = (
{
isPersisting,
onPersist,
hasChanged,
enableSave,
showDelete,
onDelete,
onCancelEdit,
}) => {
const disabled = !hasChanged || isPersisting;
const disabled = !enableSave || isPersisting;
return (
<div>
<Button
@ -38,7 +38,7 @@ const EntryEditorToolbar = (
EntryEditorToolbar.propTypes = {
isPersisting: PropTypes.bool,
onPersist: PropTypes.func.isRequired,
hasChanged: PropTypes.bool.isRequired,
enableSave: PropTypes.bool.isRequired,
showDelete: PropTypes.bool.isRequired,
onDelete: PropTypes.func.isRequired,
onCancelEdit: PropTypes.func.isRequired,

View File

@ -151,7 +151,7 @@ class EntryPage extends React.Component {
onPersist={this.handlePersistEntry}
onDelete={this.handleDeleteEntry}
showDelete={this.props.showDelete}
hasChanged={entryDraft.get('hasChanged')}
enableSave={entryDraft.get('hasChanged')}
onCancelEdit={this.handleCloseEntry}
/>
);