mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-15 20:53:49 +09:00
Move embed components to components folder
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user