update snippets

This commit is contained in:
Ray Elliott 2020-05-10 15:28:18 +00:00
parent 744744ba71
commit f75529402d
1 changed files with 22 additions and 0 deletions

View File

@ -116,3 +116,25 @@ endsnippet
snippet tb "this ... = ... .bind(this);" snippet tb "this ... = ... .bind(this);"
this.$1 = this.$1.bind(this); this.$1 = this.$1.bind(this);
endsnippet endsnippet
snippet wprb
import { registerBlockType } from '@wordpress/blocks';
const blockStyle = {
color: red,
backgroundColor: pink,
};
registerBlockType( '${1:namespace}/${2:block-name}', {
title: '$3',
icon: '${4:universal-access-alt}',
category: '${5:layout}',
example: {},
edit() {
return <div style={ blockStyle }>Hello World, step 1 (from the editor).</div>;
},
save() {
return <div style={ blockStyle }>Hello World, step 1 (from the frontend).</div>;
},
} );
endsnippet