Skip to content

Instantly share code, notes, and snippets.

@mharis
Created November 6, 2018 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mharis/8dcc58dd6b3a1f68d69aa33e16664280 to your computer and use it in GitHub Desktop.
Save mharis/8dcc58dd6b3a1f68d69aa33e16664280 to your computer and use it in GitHub Desktop.
const { __, setLocaleData } = wp.i18n;
const { registerBlockType } = wp.blocks;
const blockStyle = {
backgroundColor: '#900',
color: '#fff',
padding: '20px',
};
setLocaleData( window.gutenberg_examples_01_esnext.localeData, 'gutenberg-examples' );
registerBlockType( 'gutenberg-examples/example-01-basic-esnext', {
title: __( 'Example: Basic (esnext)', 'gutenberg-examples' ),
icon: 'universal-access-alt',
category: 'layout',
edit() {
return <div style={ blockStyle }>Basic example with JSX! (editor)</div>;
},
save() {
return <div style={ blockStyle }>Basic example with JSX! (front)</div>;
},
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment