mirror of
				https://git.disroot.org/wolfree/wolfree-dockerfile
				synced 2025-06-06 00:49:20 +02:00 
			
		
		
		
	enhance homepage performance for low-end devices
This commit is contained in:
		| @@ -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 && ( |  | ||||||
|         <iframe |  | ||||||
|           title="Input Page Preloader" |  | ||||||
|           src="/input/" |  | ||||||
|           style={{ display: "none" }} |  | ||||||
|         /> |  | ||||||
|       )} |  | ||||||
|     </> |  | ||||||
|   ); |  | ||||||
| }; |  | ||||||
| @@ -1,14 +0,0 @@ | |||||||
| /* SPDX-License-Identifier: AGPL-3.0-or-later */ |  | ||||||
|  |  | ||||||
| import Footer from "@theme-original/Footer"; |  | ||||||
| import InputPreloader from "./InputPreloader"; |  | ||||||
| import React from "react"; |  | ||||||
|  |  | ||||||
| export default ( |  | ||||||
|   props: React.JSX.ElementAttributesProperty |  | ||||||
| ): React.JSX.Element => ( |  | ||||||
|   <> |  | ||||||
|     <Footer {...props} /> |  | ||||||
|     <InputPreloader /> |  | ||||||
|   </> |  | ||||||
| ); |  | ||||||
		Reference in New Issue
	
	Block a user