add placeholder markup to example block editor file

This commit is contained in:
2026-01-04 18:02:58 +00:00
parent d0ba326cf9
commit 53ed3f5d73

View File

@@ -1,17 +1,22 @@
// block.json's editorScript, loaded only in the block editor // block.json's editorScript, loaded only in the block editor
import metadata from './block.json';
import { registerBlockType } from '@wordpress/blocks'; import { registerBlockType } from '@wordpress/blocks';
import { useBlockProps } from '@wordpress/block-editor'; import { useBlockProps } from '@wordpress/block-editor';
import metadata from './block.json'; import { containerClassNames, sectionClassNames } from '../../../js/blocks/lib/classNames';
registerBlockType(metadata.name, { registerBlockType(metadata.name, {
edit() { edit({ attributes }) {
const blockProps = useBlockProps(); const blockProps = useBlockProps();
blockProps.className = sectionClassNames(attributes, blockProps.className, ['bg-success', 'knockout']).join(' ');
return ( return (
<section { ...blockProps }> <div { ...blockProps }>
<h2>Bad Egg Block Example</h2> <div className="container align-center wysiwyg">
</section> <h2>Bad Egg Block Example</h2>
</div>
</div>
); );
} }
}); });