diff --git a/plugins/carhop-blocks/src/content-card/block.json b/plugins/carhop-blocks/src/content-card/block.json index 0626a1e..df21549 100644 --- a/plugins/carhop-blocks/src/content-card/block.json +++ b/plugins/carhop-blocks/src/content-card/block.json @@ -17,6 +17,10 @@ "style": "file:./style-index.css", "viewScript": "file:./view.js", "attributes": { + "hasBorder": { + "type": "boolean", + "default": true + }, "hasBackgroundColor": { "type": "boolean", "default": false diff --git a/plugins/carhop-blocks/src/content-card/edit.js b/plugins/carhop-blocks/src/content-card/edit.js index 171ce0f..b0ecc33 100644 --- a/plugins/carhop-blocks/src/content-card/edit.js +++ b/plugins/carhop-blocks/src/content-card/edit.js @@ -21,8 +21,13 @@ import { export default function Edit({ attributes, setAttributes, ...props }) { const colors = useSetting("color.palette.theme"); - const { hasBackgroundColor, backgroundColor, textColor, hasLightBackground } = - attributes; + const { + hasBackgroundColor, + backgroundColor, + textColor, + hasLightBackground, + hasBorder, + } = attributes; function onBackgroundColorChange(value) { if (value === undefined) { @@ -47,6 +52,16 @@ export default function Edit({ attributes, setAttributes, ...props }) { <> + setAttributes({ hasBorder: value })} + /> + + {/* @@ -78,7 +93,7 @@ export default function Edit({ attributes, setAttributes, ...props }) { /> )} - + */}
diff --git a/plugins/carhop-blocks/src/content-card/save.js b/plugins/carhop-blocks/src/content-card/save.js index cd86837..bdf73d8 100644 --- a/plugins/carhop-blocks/src/content-card/save.js +++ b/plugins/carhop-blocks/src/content-card/save.js @@ -2,8 +2,13 @@ import { useBlockProps, InnerBlocks } from "@wordpress/block-editor"; import { isColorLight } from "../../_utilities/utilities"; export default function save({ attributes }) { - const { backgroundColor, textColor, hasLightBackground, hasBackgroundColor } = - attributes; + const { + backgroundColor, + textColor, + hasLightBackground, + hasBackgroundColor, + hasBorder, + } = attributes; return (