mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-03 16:03:34 +00:00
Compare commits
1
Commits
main
...
panelHideButton
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c03858cc7 |
No files matched your search
@@ -129,6 +129,8 @@ export function AppLayout({
|
||||
selectedProject={selectedProject}
|
||||
onSelectProject={handleProjectSelect}
|
||||
className="h-screen sticky top-0"
|
||||
showCollapseButton={true}
|
||||
onCollapse={() => setIsSidebarVisible(false)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -136,16 +138,16 @@ export function AppLayout({
|
||||
{/* Main Content Area */}
|
||||
<div className="flex-1 flex flex-col bg-background">
|
||||
<div className="min-h-screen bg-gradient-to-br from-primary/5 to-accent/5 relative">
|
||||
{/* Toggle Button - positioned absolutely in top-left corner */}
|
||||
{showSidebar && (
|
||||
{/* Toggle Button - only show when sidebar is collapsed */}
|
||||
{showSidebar && !isSidebarVisible && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setIsSidebarVisible(!isSidebarVisible)}
|
||||
onClick={() => setIsSidebarVisible(true)}
|
||||
className="absolute top-2 left-4 h-8 w-8 p-0 z-10 bg-transparent backdrop-blur-sm hover:bg-transparent text-foreground/70 hover:text-foreground"
|
||||
aria-label="Toggle sidebar"
|
||||
>
|
||||
{isSidebarVisible ? <Columns2 className="h-4 w-4" /> : <Menu className="h-4 w-4" />}
|
||||
<Columns2 className="h-4 w-4" />
|
||||
</Button>
|
||||
)}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Plus, Folder, GitBranch, Settings, Loader2, ChevronDown, Star } from 'lucide-react';
|
||||
import { Plus, Folder, GitBranch, Settings, Loader2, ChevronDown, Star, Columns2 } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
|
||||
@@ -76,12 +76,16 @@ interface ProjectSidebarProps {
|
||||
selectedProject: Project | null;
|
||||
onSelectProject: (project: Project | null) => void;
|
||||
className?: string;
|
||||
showCollapseButton?: boolean;
|
||||
onCollapse?: () => void;
|
||||
}
|
||||
|
||||
export function ProjectSidebar({
|
||||
selectedProject,
|
||||
onSelectProject,
|
||||
className
|
||||
className,
|
||||
showCollapseButton = false,
|
||||
onCollapse
|
||||
}: ProjectSidebarProps) {
|
||||
const queryClient = useQueryClient();
|
||||
const { data: projects = [], isLoading, error } = useProjects();
|
||||
@@ -117,6 +121,18 @@ export function ProjectSidebar({
|
||||
</h1>
|
||||
</button>
|
||||
<div className="flex items-center gap-1">
|
||||
{/* Collapse button - shown when showCollapseButton is true */}
|
||||
{showCollapseButton && onCollapse && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-8 w-8 p-0 hover:bg-primary/10"
|
||||
onClick={onCollapse}
|
||||
aria-label="Collapse sidebar"
|
||||
>
|
||||
<Columns2 className="h-4 w-4 text-primary/60 hover:text-primary" />
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
|
||||
Reference in new issue
Block a user