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 / blocks / tabs / edit / inspector-controls.js

inspector-controls.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.2, at gutenberg/blocks/tabs/edit/inspector-controls.js

43 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { InspectorControls } from '@wordpress/block-editor';
2 import { PanelBody, SelectControl, ToggleControl } from '@wordpress/components';
3 import { __ } from '@wordpress/i18n';
4
5 export default function EditInspectorControls({ attributes, setAttributes }) {
6 const { trigger, buttonsAlign, buttonsVerticalAlign } = attributes;
7
8 return (
9 <InspectorControls>
10 <PanelBody>
11 <SelectControl
12 label={__('Select Tab Trigger', 'ghostkit')}
13 value={trigger}
14 options={[
15 {
16 value: '',
17 label: __('Click', 'ghostkit'),
18 },
19 {
20 value: 'hover',
21 label: __('Hover', 'ghostkit'),
22 },
23 ]}
24 onChange={(val) => {
25 setAttributes({ trigger: val });
26 }}
27 />
28 <ToggleControl
29 label={__('Vertical Tabs', 'ghostkit')}
30 checked={!!buttonsVerticalAlign}
31 onChange={(val) => {
32 setAttributes({ buttonsVerticalAlign: val });
33
34 if (val && buttonsAlign === 'stretch') {
35 setAttributes({ buttonsAlign: 'start' });
36 }
37 }}
38 />
39 </PanelBody>
40 </InspectorControls>
41 );
42 }
43