Skip to content

Commit

Permalink
Fix the save button label for BTP
Browse files Browse the repository at this point in the history
  • Loading branch information
okmttdhr committed Jun 9, 2023
1 parent 238d9a9 commit be8e558
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions packages/edit-site/src/components/save-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,24 @@ export default function SaveButton( {
const disabled = isSaving || ! activateSaveEnabled;

const getLabel = () => {
if ( isPreviewingTheme() ) {
if ( isSaving ) {
return __( 'Activating' );
} else if ( disabled ) {
return __( 'Saved' );
} else if ( isDirty ) {
return __( 'Activate & Save' );
}
return __( 'Activate' );
}

if ( isSaving ) {
return __( 'Saving' );
}
if ( disabled ) {
} else if ( disabled ) {
return __( 'Saved' );
} else if ( defaultLabel ) {
return defaultLabel;
}

if ( defaultLabel ) return defaultLabel;

if ( isPreviewingTheme() && isDirty ) {
return __( 'Activate & Save' );
} else if ( isPreviewingTheme() ) {
return __( 'Activate' );
}

return __( 'Save' );
};
const label = getLabel();
Expand Down

0 comments on commit be8e558

Please sign in to comment.