Iframe.js
7 years ago
core-embeds.js
7 years ago
embed-controls.js
6 years ago
embed-loading.js
7 years ago
embed-placeholder.js
6 years ago
icons.js
6 years ago
embed-controls.js
34 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | const { __ } = wp.i18n; |
| 5 | const { Fragment } = wp.element; |
| 6 | const { IconButton, Toolbar } = wp.components; |
| 7 | const { BlockControls } = wp.editor; |
| 8 | |
| 9 | const EmbedControls = ( props ) => { |
| 10 | const { |
| 11 | showEditButton, |
| 12 | switchBackToURLInput |
| 13 | } = props; |
| 14 | return ( |
| 15 | <Fragment> |
| 16 | <BlockControls> |
| 17 | <Toolbar> |
| 18 | { showEditButton && ( |
| 19 | <IconButton |
| 20 | className="components-toolbar__control" |
| 21 | label={ __( 'Edit URL' ) } |
| 22 | icon="edit" |
| 23 | onClick={ switchBackToURLInput } |
| 24 | /> |
| 25 | ) } |
| 26 | </Toolbar> |
| 27 | </BlockControls> |
| 28 | |
| 29 | </Fragment> |
| 30 | ); |
| 31 | }; |
| 32 | |
| 33 | export default EmbedControls; |
| 34 |