From b58a94eff5bfe0b174b1f67fbc91ae16e755cc6e Mon Sep 17 00:00:00 2001 From: name Date: Sat, 30 Sep 2023 12:58:57 +0000 Subject: enhance homepage performance for low-end devices --- docusaurus/src/theme/Footer/InputPreloader.tsx | 37 -------------------------- docusaurus/src/theme/Footer/index.tsx | 14 ---------- 2 files changed, 51 deletions(-) delete mode 100644 docusaurus/src/theme/Footer/InputPreloader.tsx delete mode 100644 docusaurus/src/theme/Footer/index.tsx (limited to 'docusaurus') diff --git a/docusaurus/src/theme/Footer/InputPreloader.tsx b/docusaurus/src/theme/Footer/InputPreloader.tsx deleted file mode 100644 index 2ba2e19..0000000 --- a/docusaurus/src/theme/Footer/InputPreloader.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* SPDX-License-Identifier: AGPL-3.0-or-later */ - -import React from "react"; - -export default (): React.JSX.Element => { - const [insertIframe, setInsertIframe] = React.useState(false); - - React.useEffect((): (() => void) => { - const handleIframeLoad = (): (() => void) => { - // Insert the iframe after a 3000ms delay. - const timerId = setTimeout((): void => setInsertIframe(true), 3000); - - // Cleanup the timer when the component unmounts. - return (): void => clearTimeout(timerId); - }; - - window.addEventListener("load", handleIframeLoad); - - window.scroll(0, 0); - - // Cleanup the event listener when the component unmounts. - return (): void => window.removeEventListener("load", handleIframeLoad); - }, []); // Empty dependency array means the effect runs only once after initial render. - - return ( - <> - {/* Use a descriptive title for accessibility */} - {insertIframe && ( -