mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-24 20:03:44 +03:00
27 lines
601 B
JavaScript
27 lines
601 B
JavaScript
/**
|
|
* WordPress dependencies
|
|
*/
|
|
import { registerBlockType } from '@wordpress/blocks';
|
|
import { useBlockProps } from '@wordpress/block-editor';
|
|
import ServerSideRender from '@wordpress/server-side-render';
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
import metadata from './block.json';
|
|
import './style.scss';
|
|
|
|
const Edit = ( { attributes, name } ) => {
|
|
const blockProps = useBlockProps();
|
|
return (
|
|
<div { ...blockProps }>
|
|
<ServerSideRender block={ name } attributes={ attributes } skipBlockSupportAttributes />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
registerBlockType( metadata.name, {
|
|
edit: Edit,
|
|
save: () => null,
|
|
} );
|