Skip to content

Commit

Permalink
Remove explicit store prop from downloadable plugin list
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Aug 14, 2024
1 parent c7c3bb7 commit aa04cef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function getDownloadableBlockLabel(
);
}

function DownloadableBlockListItem( { composite, item, onClick } ) {
function DownloadableBlockListItem( { item, onClick } ) {
const { author, description, icon, rating, title } = item;
// getBlockType returns a block object if this block exists, or null if not.
const isInstalled = !! getBlockType( item.name );
Expand Down Expand Up @@ -111,7 +111,6 @@ function DownloadableBlockListItem( { composite, item, onClick } ) {
tooltipPosition="top center"
/>
}
store={ composite }
disabled={ isInstalling || ! isInstallable }
>
<div className="block-directory-downloadable-block-list-item__icon">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { store as blockDirectoryStore } from '../../store';
const noop = () => {};

function DownloadableBlocksList( { items, onHover = noop, onSelect } ) {
const composite = useCompositeStore();
const compositeStore = useCompositeStore();
const { installBlockType } = useDispatch( blockDirectoryStore );

if ( ! items.length ) {
Expand All @@ -24,7 +24,7 @@ function DownloadableBlocksList( { items, onHover = noop, onSelect } ) {

return (
<Composite
store={ composite }
store={ compositeStore }
role="listbox"
className="block-directory-downloadable-blocks-list"
aria-label={ __( 'Blocks available for install' ) }
Expand All @@ -33,7 +33,6 @@ function DownloadableBlocksList( { items, onHover = noop, onSelect } ) {
return (
<DownloadableBlockListItem
key={ item.id }
composite={ composite }
onClick={ () => {
// Check if the block is registered (`getBlockType`
// will return an object). If so, insert the block.
Expand Down

0 comments on commit aa04cef

Please sign in to comment.