Skip to content

Commit

Permalink
Fix BlockInfo slot displaying logic (#50054)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras authored Apr 25, 2023
1 parent 744ba04 commit c7d0b77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ import { privateApis as componentsPrivateApis } from '@wordpress/components';
* Internal dependencies
*/
import { unlock } from '../../lock-unlock';
import useDisplayBlockControls from '../use-display-block-controls';

const { createPrivateSlotFill } = unlock( componentsPrivateApis );
const { Fill, Slot } = createPrivateSlotFill( 'BlockInformation' );

const BlockInfo = ( props ) => <Fill { ...props } />;
const BlockInfo = ( props ) => {
const isDisplayed = useDisplayBlockControls();
if ( ! isDisplayed ) {
return null;
}
return <Fill { ...props } />;
};
BlockInfo.Slot = ( props ) => <Slot { ...props } />;

export default BlockInfo;
59 changes: 0 additions & 59 deletions packages/block-library/src/query/hooks.js

This file was deleted.

0 comments on commit c7d0b77

Please sign in to comment.