From 0b919d4df84ea523ac9e069bdad5c3b34b7c603d Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Thu, 17 Jul 2025 19:33:10 +0200 Subject: refactor all timeline components --- .../editor/timeline/timeline-tracks-area.tsx | 41 ++++++++++------------ 1 file changed, 18 insertions(+), 23 deletions(-) (limited to 'apps/web/src/components/editor/timeline/timeline-tracks-area.tsx') diff --git a/apps/web/src/components/editor/timeline/timeline-tracks-area.tsx b/apps/web/src/components/editor/timeline/timeline-tracks-area.tsx index 48b47df1..e8ca1ec3 100644 --- a/apps/web/src/components/editor/timeline/timeline-tracks-area.tsx +++ b/apps/web/src/components/editor/timeline/timeline-tracks-area.tsx @@ -1,4 +1,3 @@ -import { Fragment } from "react"; import { Plus } from "lucide-react"; import { ContextMenu, @@ -7,7 +6,7 @@ import { ContextMenuTrigger, } from "../../ui/context-menu"; import { useTimelineStore } from "@/stores/timeline-store"; -import { TimelineTrackContent } from "../timeline-track"; +import { TimelineTrackContent } from "./timeline-track"; import { TrackIcon } from "./track-icon"; import { getTrackHeight } from "@/constants/timeline-constants"; import type { TimelineTrack } from "@/types/timeline"; @@ -26,16 +25,17 @@ export function TimelineTracksArea({ handleSnapPointChange, clearSelectedElements, }: TimelineTracksAreaProps) { - const { addTrack, toggleTrackMute } = useTimelineStore(); + const { toggleTrackMute } = useTimelineStore(); return ( <> - {/* Track Rows */} - {tracks.map((track, index) => ( - - {/* Left Column (Sticky Track Labels) */} +
+
+ + {tracks.map((track, index) => (
@@ -45,14 +45,17 @@ export function TimelineTracksArea({ Muted )}
+ ))} +
- {/* Scrollable Track Content */} - +
+ {tracks.map((track, index) => ( +
{ - // If clicking empty area (not on a element), deselect all elements if (!(e.target as HTMLElement).closest(".timeline-element")) { clearSelectedElements(); } @@ -72,17 +75,9 @@ export function TimelineTracksArea({ Track settings (soon) - - ))} - {/* Add Track Button - spans full width */} -
addTrack("media")} - className="col-span-1 sticky left-0 w-full flex items-center border-b border-muted bg-card hover:bg-card/50 transition-colors cursor-pointer z-[100]" - style={{ height: `${getTrackHeight("media")}px` }} - > -
- -
+ ))} + +
); -- cgit v1.3.1