Compare commits

...

2 Commits

Author SHA1 Message Date
Ray Elliott d1244444ba add .gitignore 2020-08-17 11:31:07 +01:00
Ray Elliott be412544ee add toolbaritem button 2020-08-16 22:16:14 +01:00
3 changed files with 9 additions and 16864 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
package-lock.json

16860
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,10 @@ registerBlockType(`${NAMESPACE}/${SLUG}`, {
type: 'string',
default: 'rgba(0, 0, 0, 1)',
},
toggle: {
type: 'boolean',
default: false,
},
},
edit({ attributes, setAttributes, className }) {
@ -70,11 +74,11 @@ registerBlockType(`${NAMESPACE}/${SLUG}`, {
<ToolbarGroup>
<ToolbarItem
as={Button}
onClick={() =>
console.log('Toolbar Button go brrrr!')
}
onClick={() => {
setAttributes({ toggle: !attributes.toggle });
}}
>
Toolbar Button
Toggle {attributes.toggle ? 'On' : 'Off'}
</ToolbarItem>
</ToolbarGroup>
</BlockControls>