diff --git a/plugins/carhop-blocks/src/scroll-story-block/block.json b/plugins/carhop-blocks/src/scroll-story-block/block.json index b72b172..97a9d6b 100644 --- a/plugins/carhop-blocks/src/scroll-story-block/block.json +++ b/plugins/carhop-blocks/src/scroll-story-block/block.json @@ -15,5 +15,11 @@ "editorScript": "file:./index.js", "editorStyle": "file:./index.css", "style": "file:./style-index.css", - "viewScript": "file:./view.js" + "viewScript": "file:./view.js", + "attributes": { + "hasNumbering": { + "type": "boolean", + "default": false + } + } } \ No newline at end of file diff --git a/plugins/carhop-blocks/src/scroll-story-block/edit.js b/plugins/carhop-blocks/src/scroll-story-block/edit.js index e65211c..efdc05f 100644 --- a/plugins/carhop-blocks/src/scroll-story-block/edit.js +++ b/plugins/carhop-blocks/src/scroll-story-block/edit.js @@ -1,13 +1,30 @@ import { __ } from "@wordpress/i18n"; import { useBlockProps, InnerBlocks } from "@wordpress/block-editor"; import "./editor.scss"; +import { PanelBody, CheckboxControl } from "@wordpress/components"; +import { InspectorControls } from "@wordpress/block-editor"; export default function Edit({ attributes, setAttributes }) { + const { hasNumbering } = attributes; return ( <> + + + setAttributes({ hasNumbering: value })} + /> + +
+
);