Move embed components to components folder

This commit is contained in:
Justin Foell
2021-01-29 12:38:10 -06:00
parent 62ce128cfe
commit 974cd2e908
4 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
/* global wp, wpStrava */
import EmbedPlaceholder from './embed-placeholder';
import EmbedControls from './embed-controls';
import EmbedPlaceholder from '../components/embed-placeholder';
import EmbedControls from '../components/embed-controls';
import SOMOverride from '../components/som-override';
const { __ } = wp.i18n;
-34
View File
@@ -1,34 +0,0 @@
/**
* WordPress dependencies
*/
import { BlockControls } from '@wordpress/editor';
const { __ } = wp.i18n;
const {
Icon,
Button,
Toolbar,
} = wp.components;
const EmbedControls = ( props ) => {
const {
switchBackToURLInput,
} = props;
return (
<>
<BlockControls>
<Toolbar>
<Button
label={ __( 'Edit URL' ) }
onClick={ switchBackToURLInput }
>
<Icon icon="edit" />
</Button>
</Toolbar>
</BlockControls>
</>
);
};
export default EmbedControls;
-45
View File
@@ -1,45 +0,0 @@
/**
* WordPress dependencies
*/
import { BlockIcon } from '@wordpress/editor';
const { __, _x } = wp.i18n;
const { Button, Placeholder } = wp.components;
const EmbedPlaceholder = ( props ) => {
const {
icon,
label,
value,
onSubmit,
onChange,
} = props;
return (
<Placeholder
icon={ <BlockIcon icon={ icon } showColors /> }
label={ label }
className="wp-block-embed"
instructions={ __(
'Paste a link to the Strava Activity you want to display on your site.'
) }
>
<form onSubmit={ onSubmit }>
<input
type="url"
value={ value || '' }
className="components-placeholder__input"
aria-label={ label }
placeholder={ __( 'Enter Activity URL to embed here…' ) }
onChange={ onChange }
/>
<Button isPrimary type="submit">
{ _x( 'Embed', 'button label' ) }
</Button>
</form>
</Placeholder>
);
};
export default EmbedPlaceholder;