Heray-Was-Here
Server : Apache/2.4.52 (Debian)
System : Linux 1b21ca041b67 5.10.0-44-amd64 #1 SMP Debian 5.10.257-1 (2026-05-27) x86_64
User : www-data ( 33)
PHP Version : 7.4.28
Disable Function : NONE
Directory :  /var/www/html/wp-content/plugins/leadin/scripts/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/wp-content/plugins/leadin/scripts/utils/iframe.ts
import { useEffect, useState } from 'react';

const IFRAME_DISPLAY_TIMEOUT = 5000;

export function useIframeNotRendered(app: string) {
  const [iframeNotRendered, setIframeNotRendered] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      const iframe = document.getElementById(app);
      if (!iframe) {
        setIframeNotRendered(true);
      }
    }, IFRAME_DISPLAY_TIMEOUT);

    return () => {
      if (timer) {
        clearTimeout(timer);
      }
    };
  }, []);

  return iframeNotRendered;
}

export const resizeWindow = () => {
  const adminMenuWrap = document.getElementById('adminmenuwrap');
  const sideMenuHeight = adminMenuWrap ? adminMenuWrap.offsetHeight : 0;
  const adminBar = document.getElementById('wpadminbar');
  const adminBarHeight = (adminBar && adminBar.offsetHeight) || 0;
  const offset = 4;
  if (window.innerHeight < sideMenuHeight) {
    return sideMenuHeight - offset;
  } else {
    return window.innerHeight - adminBarHeight - offset;
  }
};

Hry