Skip to content

Commit

Permalink
keep publish panel rendered for post publish panel
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Apr 1, 2024
1 parent 5616b5a commit 0b40d06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions packages/edit-site/src/components/header-edit-mode/index.js
Expand Up @@ -79,8 +79,6 @@ export default function HeaderEditMode( { setEntitiesSavedStatesCallback } ) {
select( editSiteStore )
).getEditorCanvasContainerView(),
isDistractionFree: getPreference( 'core', 'distractionFree' ),
// TODO: by unmounting the `publish` button, we cannot render
// post-publish panel...
showPublishButton:
currentPostIsDraft && ! hasNonPostEntityChanges(),
};
Expand Down
10 changes: 7 additions & 3 deletions packages/edit-site/src/components/layout/index.js
Expand Up @@ -84,8 +84,11 @@ export default function Layout() {
keyboardShortcutsStore
);
const { getCanvasMode } = unlock( select( editSiteStore ) );
const { getCurrentPostAttribute, hasNonPostEntityChanges } =
select( editorStore );
const {
getCurrentPostAttribute,
hasNonPostEntityChanges,
isPublishSidebarOpened,
} = select( editorStore );
const currentPostIsDraft =
getCurrentPostAttribute( 'status' ) === 'draft';
return {
Expand All @@ -110,7 +113,8 @@ export default function Layout() {
hasBlockSelected:
select( blockEditorStore ).getBlockSelectionStart(),
showPublishButton:
currentPostIsDraft && ! hasNonPostEntityChanges(),
! hasNonPostEntityChanges() &&
( currentPostIsDraft || isPublishSidebarOpened() ),
};
}, [] );
const navigateRegionsProps = useNavigateRegions( {
Expand Down

0 comments on commit 0b40d06

Please sign in to comment.