diff --git a/packages/editor/README.md b/packages/editor/README.md index 8b48d773acb268..dd7b53f421a1db 100644 --- a/packages/editor/README.md +++ b/packages/editor/README.md @@ -401,7 +401,7 @@ _Parameters_ - _props_ `Object`: The component props. - _props.close_ `Function`: The function to close the dialog. -- _props.renderDialog_ `Function`: The function to render the dialog. +- _props.renderDialog_ `boolean`: Whether to render the component with modal dialog behavior. _Returns_ diff --git a/packages/editor/src/components/entities-saved-states/index.js b/packages/editor/src/components/entities-saved-states/index.js index ea05bca522941b..c60a271ea8c846 100644 --- a/packages/editor/src/components/entities-saved-states/index.js +++ b/packages/editor/src/components/entities-saved-states/index.js @@ -31,14 +31,11 @@ function identity( values ) { * * @param {Object} props The component props. * @param {Function} props.close The function to close the dialog. - * @param {Function} props.renderDialog The function to render the dialog. + * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior. * * @return {React.ReactNode} The rendered component. */ -export default function EntitiesSavedStates( { - close, - renderDialog = undefined, -} ) { +export default function EntitiesSavedStates( { close, renderDialog = false } ) { const isDirtyProps = useIsDirty(); return ( { __( 'Are you ready to save?' ) } - { additionalPrompt } -

- { isDirty - ? createInterpolateElement( - sprintf( - /* translators: %d: number of site changes waiting to be saved. */ - _n( - 'There is %d site change waiting to be saved.', - 'There are %d site changes waiting to be saved.', +

+ { additionalPrompt } +

+ { isDirty + ? createInterpolateElement( + sprintf( + /* translators: %d: number of site changes waiting to be saved. */ + _n( + 'There is %d site change waiting to be saved.', + 'There are %d site changes waiting to be saved.', + dirtyEntityRecords.length + ), dirtyEntityRecords.length ), - dirtyEntityRecords.length - ), - { strong: } - ) - : __( 'Select the items you want to save.' ) } -

+ { strong: } + ) + : __( 'Select the items you want to save.' ) } +

+
{ sortedPartitionedSavables.map( ( list ) => {