Compare commits
2 Commits
2d4e04211b
...
d1244444ba
Author | SHA1 | Date |
---|---|---|
Ray Elliott | d1244444ba | |
Ray Elliott | be412544ee |
|
@ -0,0 +1 @@
|
||||||
|
package-lock.json
|
File diff suppressed because it is too large
Load Diff
12
src/index.js
12
src/index.js
|
@ -45,6 +45,10 @@ registerBlockType(`${NAMESPACE}/${SLUG}`, {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: 'rgba(0, 0, 0, 1)',
|
default: 'rgba(0, 0, 0, 1)',
|
||||||
},
|
},
|
||||||
|
toggle: {
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
edit({ attributes, setAttributes, className }) {
|
edit({ attributes, setAttributes, className }) {
|
||||||
|
@ -70,11 +74,11 @@ registerBlockType(`${NAMESPACE}/${SLUG}`, {
|
||||||
<ToolbarGroup>
|
<ToolbarGroup>
|
||||||
<ToolbarItem
|
<ToolbarItem
|
||||||
as={Button}
|
as={Button}
|
||||||
onClick={() =>
|
onClick={() => {
|
||||||
console.log('Toolbar Button go brrrr!')
|
setAttributes({ toggle: !attributes.toggle });
|
||||||
}
|
}}
|
||||||
>
|
>
|
||||||
Toolbar Button
|
Toggle {attributes.toggle ? 'On' : 'Off'}
|
||||||
</ToolbarItem>
|
</ToolbarItem>
|
||||||
</ToolbarGroup>
|
</ToolbarGroup>
|
||||||
</BlockControls>
|
</BlockControls>
|
||||||
|
|
Loading…
Reference in New Issue