Skip to content

Commit

Permalink
revert block pattern fetched parsed blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Mar 29, 2021
1 parent 220fa20 commit 7d36548
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@ import {
} from '@wordpress/components';
import { useInstanceId } from '@wordpress/compose';
import { __ } from '@wordpress/i18n';
import { useSelect } from '@wordpress/data';

/**
* Internal dependencies
*/
import BlockPreview from '../block-preview';
import InserterDraggableBlocks from '../inserter-draggable-blocks';
import { store as blockEditorStore } from '../../store';

function BlockPattern( { isDraggable, pattern, onClick, composite } ) {
const { name, viewportWidth } = pattern;
const { blocks } = useSelect(
( select ) =>
select( blockEditorStore ).__experimentalGetParsedPattern( name ),
[ name ]
);
const instanceId = useInstanceId( BlockPattern );
const { viewportWidth, blocks } = pattern;
const descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;

return (
<InserterDraggableBlocks isEnabled={ isDraggable } blocks={ blocks }>
{ ( { draggable, onDragStart, onDragEnd } ) => (
Expand Down

0 comments on commit 7d36548

Please sign in to comment.