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 / element-state-toggle / index.js

index.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.2, at gutenberg/components/element-state-toggle/index.js

34 lines 644 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { Button } from '@wordpress/components';
2 import { __ } from '@wordpress/i18n';
3
4 import getIcon from '../../utils/get-icon';
5 import ActiveIndicator from '../active-indicator';
6
7 /**
8 * Component Class
9 *
10 * @param props
11 */
12 export default function ElementStateToggle(props) {
13 const {
14 isHover,
15 onChange,
16 checkActive = () => {
17 return false;
18 },
19 } = props;
20
21 return (
22 <Button
23 className="ghostkit-control-element-state-toggle"
24 onClick={() => {
25 onChange(!isHover);
26 }}
27 >
28 {getIcon('icon-pointer')}
29 {checkActive() && <ActiveIndicator />}
30 {isHover && <span>{__(':hover', 'ghostkit')}</span>}
31 </Button>
32 );
33 }
34