Skip to content

Commit 6f2ef2c

Browse files
ciampoMamaduka
authored andcommitted
storybook: Update BlockPopover fixture to API version 3 (WordPress#83642)
Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
1 parent 3878304 commit 6f2ef2c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/block-editor/src/components/block-popover/stories/index.story.jsx‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
import { useMemo } from '@wordpress/element';
77
import BlockPopover from '../';
88
import BlockList from '../../block-list';
9+
import { useBlockProps } from '../../block-list/use-block-props';
910
import { ExperimentalBlockEditorProvider } from '../../provider';
1011

1112
// A minimal block type, so that the story doesn't depend on the block library.
@@ -18,19 +19,24 @@ const clientIds = BLOCK_LABELS.map(
1819
( label, index ) => `example-block-${ index + 1 }`
1920
);
2021

22+
function ExampleEdit( { attributes } ) {
23+
return <p { ...useBlockProps() }>{ attributes.content }</p>;
24+
}
25+
2126
// Registered when the story renders rather than when this file loads, so that
2227
// the example block type doesn't leak into the registry shared with the other
2328
// stories.
2429
function useExampleBlocks() {
2530
return useMemo( () => {
2631
if ( ! getBlockType( BLOCK_NAME ) ) {
2732
registerBlockType( BLOCK_NAME, {
33+
apiVersion: 3,
2834
title: 'Example',
2935
category: 'text',
3036
attributes: {
3137
content: { type: 'string' },
3238
},
33-
edit: ( { attributes } ) => attributes.content,
39+
edit: ExampleEdit,
3440
save: () => null,
3541
} );
3642
}

0 commit comments

Comments
 (0)