diff options
| author | Anwarul Islam <anwaarulislaam@gmail.com> | 2025-07-12 23:40:38 +0600 |
|---|---|---|
| committer | Anwarul Islam <anwaarulislaam@gmail.com> | 2025-07-12 23:40:38 +0600 |
| commit | 70517fec18aa13e4beb5b7c988c6abc6c0a7b155 (patch) | |
| tree | 79ccaa1460e28a5e3c277ef908c2a2c6d4905489 | |
| parent | 22db0b8b893621a8f714e4ae2fff6cebf1df1394 (diff) | |
| download | opencut-70517fec18aa13e4beb5b7c988c6abc6c0a7b155.tar.gz | |
fix: improve layout and styling of resizable panels
| -rw-r--r-- | apps/web/src/app/editor/[project_id]/page.tsx | 7 | ||||
| -rw-r--r-- | apps/web/src/components/ui/resizable.tsx | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/apps/web/src/app/editor/[project_id]/page.tsx b/apps/web/src/app/editor/[project_id]/page.tsx index db17dd4a..b3641e3e 100644 --- a/apps/web/src/app/editor/[project_id]/page.tsx +++ b/apps/web/src/app/editor/[project_id]/page.tsx @@ -55,9 +55,9 @@ export default function Editor() { return ( <EditorProvider> - <div className="h-screen w-screen flex flex-col bg-background overflow-hidden"> + <div className="h-screen w-screen flex flex-col bg-background"> <EditorHeader /> - <div className="flex-1 min-h-0 min-w-0"> + <div className="flex-1 overflow-hidden"> <ResizablePanelGroup direction="vertical" className="h-full w-full gap-1" @@ -67,7 +67,6 @@ export default function Editor() { minSize={30} maxSize={85} onResize={setMainContent} - className="min-h-0" > {/* Main content area */} <ResizablePanelGroup @@ -119,7 +118,7 @@ export default function Editor() { minSize={15} maxSize={70} onResize={setTimeline} - className="min-h-0 px-2 pb-2" + className="px-2 pb-2" > <Timeline /> </ResizablePanel> diff --git a/apps/web/src/components/ui/resizable.tsx b/apps/web/src/components/ui/resizable.tsx index 8f3cb2e8..0b9a955c 100644 --- a/apps/web/src/components/ui/resizable.tsx +++ b/apps/web/src/components/ui/resizable.tsx @@ -29,11 +29,17 @@ const ResizableHandle = ({ }) => ( <ResizablePrimitive.PanelResizeHandle className={cn( - "relative w-0 bg-transparent cursor-col-resize data-[panel-group-direction=vertical]:h-0 data-[panel-group-direction=vertical]:cursor-row-resize", + "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90", className )} {...props} - /> + > + {withHandle && ( + <div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border"> + <GripVertical className="h-2.5 w-2.5" /> + </div> + )} + </ResizablePrimitive.PanelResizeHandle> ); export { ResizablePanelGroup, ResizablePanel, ResizableHandle }; |
