carnet layout

This commit is contained in:
alma 2025-04-20 16:26:02 +02:00
parent 00a4f4d299
commit af80e771e5

View File

@ -153,74 +153,78 @@ export default function CarnetPage() {
}
return (
<main className="flex h-[calc(100vh-3.5rem)] mt-14 bg-carnet-bg">
{/* Navigation Panel */}
{showNav && (
<>
<div
className="flex flex-col h-full bg-carnet-sidebar"
style={{ width: `${navWidth}px` }}
>
<Navigation
layout={layoutMode}
onLayoutChange={setLayoutMode}
nextcloudFolders={nextcloudFolders}
onFolderSelect={handleFolderSelect}
/>
<main className="w-full h-screen bg-black">
<div className="w-full h-full px-4 pt-12 pb-4">
<div className="flex h-full bg-carnet-bg">
{/* Navigation Panel */}
{showNav && (
<>
<div
className="flex flex-col h-full bg-carnet-sidebar"
style={{ width: `${navWidth}px` }}
>
<Navigation
layout={layoutMode}
onLayoutChange={setLayoutMode}
nextcloudFolders={nextcloudFolders}
onFolderSelect={handleFolderSelect}
/>
</div>
{/* Navigation Resizer */}
<PanelResizer
isDragging={isDraggingNav}
onDragStart={() => setIsDraggingNav(true)}
onDragEnd={() => setIsDraggingNav(false)}
onDrag={handleNavResize}
/>
</>
)}
{/* Notes Panel */}
{showNotes && (
<>
<div
className="flex flex-col h-full bg-carnet-bg"
style={{ width: `${notesWidth}px` }}
>
<NotesView onNoteSelect={handleNoteSelect} />
</div>
{/* Notes Resizer */}
<PanelResizer
isDragging={isDraggingNotes}
onDragStart={() => setIsDraggingNotes(true)}
onDragEnd={() => setIsDraggingNotes(false)}
onDrag={handleNotesResize}
/>
</>
)}
{/* Editor Panel */}
<div className="flex-1 flex flex-col h-full bg-carnet-bg">
<Editor note={selectedNote} onSave={handleNoteSave} />
</div>
{/* Navigation Resizer */}
<PanelResizer
isDragging={isDraggingNav}
onDragStart={() => setIsDraggingNav(true)}
onDragEnd={() => setIsDraggingNav(false)}
onDrag={handleNavResize}
/>
</>
)}
{/* Notes Panel */}
{showNotes && (
<>
<div
className="flex flex-col h-full bg-carnet-bg"
style={{ width: `${notesWidth}px` }}
>
<NotesView onNoteSelect={handleNoteSelect} />
</div>
{/* Notes Resizer */}
<PanelResizer
isDragging={isDraggingNotes}
onDragStart={() => setIsDraggingNotes(true)}
onDragEnd={() => setIsDraggingNotes(false)}
onDrag={handleNotesResize}
/>
</>
)}
{/* Editor Panel */}
<div className="flex-1 flex flex-col h-full bg-carnet-bg">
<Editor note={selectedNote} onSave={handleNoteSave} />
</div>
{/* Mobile Navigation Toggle */}
{isMobile && (
<div className="fixed bottom-4 right-4 flex space-x-2">
<button
className="p-2 rounded-full bg-primary text-white"
onClick={() => setShowNav(!showNav)}
>
{showNav ? 'Hide Nav' : 'Show Nav'}
</button>
<button
className="p-2 rounded-full bg-primary text-white"
onClick={() => setShowNotes(!showNotes)}
>
{showNotes ? 'Hide Notes' : 'Show Notes'}
</button>
{/* Mobile Navigation Toggle */}
{isMobile && (
<div className="fixed bottom-4 right-4 flex space-x-2">
<button
className="p-2 rounded-full bg-primary text-white"
onClick={() => setShowNav(!showNav)}
>
{showNav ? 'Hide Nav' : 'Show Nav'}
</button>
<button
className="p-2 rounded-full bg-primary text-white"
onClick={() => setShowNotes(!showNotes)}
>
{showNotes ? 'Hide Notes' : 'Show Notes'}
</button>
</div>
)}
</div>
)}
</div>
</main>
);
}