Skip to content

Commit

Permalink
i18n: Add pattern block
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Jul 6, 2021
1 parent 3faa88b commit bbfe7c4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/block-library/src/pattern/edit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import {
store as blockEditorStore,
BlockList,
BlockEditorProvider,
} from '@wordpress/block-editor';

const PatternEdit = ( { attributes } ) => {
const selectedPattern = useSelect( ( select ) =>
select( blockEditorStore ).__experimentalGetParsedPattern( attributes.slug )
);

return (
<BlockEditorProvider value={ selectedPattern.blocks }>
<BlockList />
</BlockEditorProvider>
);
};

export default PatternEdit;

0 comments on commit bbfe7c4

Please sign in to comment.