Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow moving metaboxes to previously empty area #25187

Merged
merged 12 commits into from
Oct 25, 2021
11 changes: 2 additions & 9 deletions packages/edit-post/src/components/meta-boxes/index.js
Original file line number Diff line number Diff line change
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 } />
</>
);
}