From 8db3bead13441a5882d8689dfc6a9f09c82375d9 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 25 Mar 2026 16:47:22 +0100 Subject: feat: masks, properties refactor, shaders, storage migrations, and more --- apps/web/src/hooks/use-reveal-item.ts | 36 ----------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 apps/web/src/hooks/use-reveal-item.ts (limited to 'apps/web/src/hooks/use-reveal-item.ts') diff --git a/apps/web/src/hooks/use-reveal-item.ts b/apps/web/src/hooks/use-reveal-item.ts deleted file mode 100644 index 5004f60c..00000000 --- a/apps/web/src/hooks/use-reveal-item.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { useEffect, useState, useRef } from "react"; - -export function useRevealItem( - highlightId: string | null, - onClearHighlight: () => void, - highlightDuration = 1000, -) { - const [highlightedId, setHighlightedId] = useState(null); - const elementRefs = useRef>(new Map()); - - const registerElement = (id: string, element: HTMLElement | null) => { - if (element) { - elementRefs.current.set(id, element); - } else { - elementRefs.current.delete(id); - } - }; - - useEffect(() => { - if (!highlightId) return; - - setHighlightedId(highlightId); - - const target = elementRefs.current.get(highlightId); - target?.scrollIntoView({ block: "center" }); - - const timeout = setTimeout(() => { - setHighlightedId(null); - onClearHighlight(); - }, highlightDuration); - - return () => clearTimeout(timeout); - }, [highlightId, onClearHighlight, highlightDuration]); - - return { highlightedId, registerElement }; -} -- cgit v1.3.1