Skip to content

Commit

Permalink
Test extensible SaveButton
Browse files Browse the repository at this point in the history
  • Loading branch information
okmttdhr committed Dec 6, 2023
1 parent f33c269 commit 9929ca0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/edit-site/src/components/save-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ export default function SaveButton( {
setIsSaveViewOpened( true );
}, [ customizedSaveButtonAction, setIsSaveViewOpened ]);

// For testing
const { updateSettings } = useDispatch( editSiteStore );
useEffect( () => {
updateSettings( {
__experimentalSaveButtonAction: () => console.log('Customized Action'),
__experimentalSaveButtonLabel: 'Customized Action',
} );
}, [ updateSettings ] );

const activateSaveEnabled = isPreviewingTheme() || isDirty;
const disabled = isSaving || ! activateSaveEnabled;

Expand Down

0 comments on commit 9929ca0

Please sign in to comment.