Skip to content

Commit

Permalink
Allow moving metaboxes to previously empty area - fixes #7960 (#25187)
Browse files Browse the repository at this point in the history
* Fixes #7960

* Remove isVisible from withSelect

* Restore some files from trunk

Co-authored-by: Bruno Ribarić <bruno@ribarich.me>
  • Loading branch information
2 people authored and vcanales committed Oct 27, 2021
1 parent 226b0e7 commit e5d9d72
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/edit-post/src/components/meta-boxes/index.js
Expand Up @@ -19,22 +19,15 @@ import { store as editPostStore } from '../../store';

export default function MetaBoxes( { location } ) {
const registry = useRegistry();
const {
metaBoxes,
isVisible,
areMetaBoxesInitialized,
isEditorReady,
} = useSelect(
const { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(
( select ) => {
const { __unstableIsEditorReady } = select( editorStore );
const {
isMetaBoxLocationVisible,
getMetaBoxesPerLocation,
areMetaBoxesInitialized: _areMetaBoxesInitialized,
} = select( editPostStore );
return {
metaBoxes: getMetaBoxesPerLocation( location ),
isVisible: isMetaBoxLocationVisible( location ),
areMetaBoxesInitialized: _areMetaBoxesInitialized(),
isEditorReady: __unstableIsEditorReady(),
};
Expand All @@ -60,7 +53,7 @@ export default function MetaBoxes( { location } ) {
{ map( metaBoxes, ( { id } ) => (
<MetaBoxVisibility key={ id } id={ id } />
) ) }
{ isVisible && <MetaBoxesArea location={ location } /> }
<MetaBoxesArea location={ location } />
</>
);
}

0 comments on commit e5d9d72

Please sign in to comment.