From 4108881441e46281a3d28fd65ecb5ca2c27cf42a Mon Sep 17 00:00:00 2001 From: Melloware Date: Tue, 9 Jan 2024 15:09:46 -0500 Subject: [PATCH] Delete components/templates/templatefeaturesanimation directory (#5714) --- .../templatefeaturesanimation/useVisible.js | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 components/templates/templatefeaturesanimation/useVisible.js diff --git a/components/templates/templatefeaturesanimation/useVisible.js b/components/templates/templatefeaturesanimation/useVisible.js deleted file mode 100644 index 13584e17f9..0000000000 --- a/components/templates/templatefeaturesanimation/useVisible.js +++ /dev/null @@ -1,29 +0,0 @@ -import { useEffect, useState } from 'react'; - -const useVisible = (element, rootMargin = 0.2) => { - const [isVisible, setIsVisible] = useState(false); - - useEffect(() => { - const observer = new IntersectionObserver( - ([entry]) => { - setIsVisible(entry.isIntersecting); - }, - { threshold: rootMargin } - ); - - if (element.current) { - observer.observe(element.current); - } - - return () => { - if (observer && element.current) { - // eslint-disable-next-line react-hooks/exhaustive-deps - observer.unobserve(element.current); - } - }; - }, [element, rootMargin]); - - return isVisible; -}; - -export default useVisible;