Switched back to component extension

This is for maximum backwards compatibility as React Hook implementation is only supported in WP 5.2 and above.
This commit is contained in:
Justin Foell
2020-03-27 13:16:10 -05:00
parent a40f239388
commit bb7aad9063
4 changed files with 81 additions and 49 deletions
+33
View File
@@ -0,0 +1,33 @@
/**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const {
Icon,
Button,
Toolbar,
} = wp.components;
const { BlockControls } = wp.blockEditor;
const EmbedControls = ( props ) => {
const {
switchBackToURLInput,
} = props;
return (
<>
<BlockControls>
<Toolbar>
<Button
label={ __( 'Edit URL' ) }
onClick={ switchBackToURLInput }
>
<Icon icon="edit" />
</Button>
</Toolbar>
</BlockControls>
</>
);
};
export default EmbedControls;