PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.2
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.2
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / components / button-clear-media / index.js

index.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.2, at gutenberg/components/button-clear-media/index.js

33 lines 631 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { Button, PanelRow } from '@wordpress/components';
2 import { __ } from '@wordpress/i18n';
3
4 export default function ButtonClearMedia({
5 nameAttributes,
6 setAttributes,
7 children = __('Clear Media', 'ghostkit'),
8 }) {
9 const handleClick = (e) => {
10 const clearAttributes = {};
11 nameAttributes.forEach((name) => {
12 clearAttributes[name] = '';
13 });
14 setAttributes(clearAttributes);
15
16 e.preventDefault();
17 };
18
19 return (
20 <PanelRow>
21 <Button
22 variant="secondary"
23 size="small"
24 onClick={handleClick}
25 className="is-small"
26 style={{ marginLeft: 'auto' }}
27 >
28 {children}
29 </Button>
30 </PanelRow>
31 );
32 }
33