diff --git a/resources/views/blocks/example/index.jsx b/resources/views/blocks/example/index.jsx index ddbf82f..6b4f397 100644 --- a/resources/views/blocks/example/index.jsx +++ b/resources/views/blocks/example/index.jsx @@ -1,17 +1,22 @@ // block.json's editorScript, loaded only in the block editor +import metadata from './block.json'; import { registerBlockType } from '@wordpress/blocks'; import { useBlockProps } from '@wordpress/block-editor'; -import metadata from './block.json'; +import { containerClassNames, sectionClassNames } from '../../../js/blocks/lib/classNames'; registerBlockType(metadata.name, { - edit() { + edit({ attributes }) { const blockProps = useBlockProps(); + blockProps.className = sectionClassNames(attributes, blockProps.className, ['bg-success', 'knockout']).join(' '); + return ( -
-

Bad Egg Block Example

-
+
+
+

Bad Egg Block Example

+
+
); } });