Server IP : 66.29.132.124 / Your IP : 3.145.58.141 Web Server : LiteSpeed System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : wavevlvu ( 1524) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/wavevlvu/cynthiaadediran.com/wp-content/plugins/extendify/src/HelpCenter/ |
Upload File : |
import { useEffect } from '@wordpress/element'; import { AnimatePresence } from 'framer-motion'; import { Modal } from '@help-center/components/modal/Modal'; import { GuidedTour } from '@help-center/components/tours/GuidedTour'; import { useRouter } from '@help-center/hooks/useRouter'; import { useGlobalSyncStore } from '@help-center/state/globals-sync'; export const HelpCenter = () => { // register a custom event to hide the Help Center. const { setVisibility, visibility } = useGlobalSyncStore(); const { navigateTo } = useRouter(); useEffect(() => { const handleOpen = (event) => { event?.detail?.page && navigateTo(event.detail.page); setVisibility('open'); }; const handleMinimize = () => { if (visibility !== 'open') return; setVisibility('minimized'); }; window.addEventListener('extendify-hc:open', handleOpen); window.addEventListener('extendify-hc:minimize', handleMinimize); return () => { window.removeEventListener('extendify-hc:open', handleOpen); window.removeEventListener('extendify-hc:minimize', handleMinimize); }; }, [setVisibility, visibility, navigateTo]); return ( <> <AnimatePresence> <Modal /> </AnimatePresence> <GuidedTour /> </> ); };