Server IP : 192.158.238.246 / Your IP : 3.22.70.102 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/jenniferflocom/www/wp-content/plugins/gutenkit-blocks-addon/src/blocks/team/ |
Upload File : |
import { __ } from '@wordpress/i18n'; import { useBlockProps } from '@wordpress/block-editor'; import Settings from './settings'; import './editor.scss'; import Markup from './parts/markup'; import { useRef, useEffect } from '@wordpress/element'; import { useMergeRefs } from '@wordpress/compose'; import classnames from 'classnames' import {handleEvent} from './Event'; export default function Edit({ attributes, setAttributes, advancedControl }) { const { GkitStyle } = window.gutenkit.components; const { useDeviceType } = window.gutenkit.helpers; const teamRef = useRef(null); const blockProps = useBlockProps({ className: classnames({[`gkit-animation-${attributes?.hoverAnimation?.effect?.value}`]: attributes?.hoverAnimationSwitch}), ref: useMergeRefs([teamRef]), }); const device = useDeviceType(); useEffect(() => { const team = teamRef.current; if (attributes.enablePopup) { handleEvent(team, true, true); } else { handleEvent(team, false, true); } }, [attributes.enablePopup, attributes.style]); return ( <> <GkitStyle blocksCSS={attributes?.blocksCSS} /> <Settings attributes={attributes} setAttributes={setAttributes} device={device} advancedControl={advancedControl} /> <div {...blockProps} data-team-popup={attributes.enablePopup}> <Markup attributes={attributes} isEdit={true} teamRef={teamRef}/> </div> </> ); }