diff options
| author | Simon Orzel <simonorzel@gmail.com> | 2025-07-17 03:00:38 +0200 |
|---|---|---|
| committer | Simon Orzel <simonorzel@gmail.com> | 2025-07-17 03:00:38 +0200 |
| commit | 167f366c6d791dfc054d64f50e83828960668e55 (patch) | |
| tree | 28d6b037a2d0597990d290520a8265cca1ef66d7 /apps/web/src/components/editor/timeline/timeline-wheel-handler.tsx | |
| parent | 1505c1b12f516c65b6a3d076f0e9623a294031d6 (diff) | |
| download | opencut-167f366c6d791dfc054d64f50e83828960668e55.tar.gz | |
feat: bunx biome format --write .
Diffstat (limited to 'apps/web/src/components/editor/timeline/timeline-wheel-handler.tsx')
| -rw-r--r-- | apps/web/src/components/editor/timeline/timeline-wheel-handler.tsx | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/apps/web/src/components/editor/timeline/timeline-wheel-handler.tsx b/apps/web/src/components/editor/timeline/timeline-wheel-handler.tsx index 417cbbe8..8036b96c 100644 --- a/apps/web/src/components/editor/timeline/timeline-wheel-handler.tsx +++ b/apps/web/src/components/editor/timeline/timeline-wheel-handler.tsx @@ -1,30 +1,32 @@ import { useEffect } from "react"; export interface TimelineWheelHandlerProps { - timelineRef: React.RefObject<HTMLDivElement>; - isInTimeline: boolean; - handleWheel: (e: React.WheelEvent) => void; + timelineRef: React.RefObject<HTMLDivElement>; + isInTimeline: boolean; + handleWheel: (e: React.WheelEvent) => void; } export function useTimelineWheelHandler({ - timelineRef, - isInTimeline, - handleWheel, + timelineRef, + isInTimeline, + handleWheel, }: TimelineWheelHandlerProps) { - useEffect(() => { - const timelineContainer = timelineRef.current; - if (!timelineContainer || !isInTimeline) return; + useEffect(() => { + const timelineContainer = timelineRef.current; + if (!timelineContainer || !isInTimeline) return; - const handleWheelCapture = (e: WheelEvent) => { - handleWheel(e as any); - }; + const handleWheelCapture = (e: WheelEvent) => { + handleWheel(e as any); + }; - timelineContainer.addEventListener("wheel", handleWheelCapture, { passive: false }); + timelineContainer.addEventListener("wheel", handleWheelCapture, { + passive: false, + }); - return () => { - timelineContainer.removeEventListener("wheel", handleWheelCapture); - }; - }, [handleWheel, isInTimeline, timelineRef]); + return () => { + timelineContainer.removeEventListener("wheel", handleWheelCapture); + }; + }, [handleWheel, isInTimeline, timelineRef]); - return null; + return null; } |
