fix: improve layout and styling of resizable panels

This commit is contained in:
Anwarul Islam
2025-07-12 23:40:38 +06:00
parent 22db0b8b89
commit 70517fec18
2 changed files with 11 additions and 6 deletions

View File

@ -55,9 +55,9 @@ export default function Editor() {
return ( return (
<EditorProvider> <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 /> <EditorHeader />
<div className="flex-1 min-h-0 min-w-0"> <div className="flex-1 overflow-hidden">
<ResizablePanelGroup <ResizablePanelGroup
direction="vertical" direction="vertical"
className="h-full w-full gap-1" className="h-full w-full gap-1"
@ -67,7 +67,6 @@ export default function Editor() {
minSize={30} minSize={30}
maxSize={85} maxSize={85}
onResize={setMainContent} onResize={setMainContent}
className="min-h-0"
> >
{/* Main content area */} {/* Main content area */}
<ResizablePanelGroup <ResizablePanelGroup
@ -119,7 +118,7 @@ export default function Editor() {
minSize={15} minSize={15}
maxSize={70} maxSize={70}
onResize={setTimeline} onResize={setTimeline}
className="min-h-0 px-2 pb-2" className="px-2 pb-2"
> >
<Timeline /> <Timeline />
</ResizablePanel> </ResizablePanel>

View File

@ -29,11 +29,17 @@ const ResizableHandle = ({
}) => ( }) => (
<ResizablePrimitive.PanelResizeHandle <ResizablePrimitive.PanelResizeHandle
className={cn( 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 className
)} )}
{...props} {...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 }; export { ResizablePanelGroup, ResizablePanel, ResizableHandle };