mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-24 06:34:46 +08:00
fix: hide chats when sidebar is not open
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
|||||||
SidebarContent,
|
SidebarContent,
|
||||||
SidebarFooter,
|
SidebarFooter,
|
||||||
SidebarRail,
|
SidebarRail,
|
||||||
|
useSidebar,
|
||||||
} from "@/components/ui/sidebar";
|
} from "@/components/ui/sidebar";
|
||||||
|
|
||||||
import { RecentChatList } from "./recent-chat-list";
|
import { RecentChatList } from "./recent-chat-list";
|
||||||
@@ -16,6 +17,7 @@ import { WorkspaceNavMenu } from "./workspace-nav-menu";
|
|||||||
export function WorkspaceSidebar({
|
export function WorkspaceSidebar({
|
||||||
...props
|
...props
|
||||||
}: React.ComponentProps<typeof Sidebar>) {
|
}: React.ComponentProps<typeof Sidebar>) {
|
||||||
|
const { open: isSidebarOpen } = useSidebar();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Sidebar variant="sidebar" collapsible="icon" {...props}>
|
<Sidebar variant="sidebar" collapsible="icon" {...props}>
|
||||||
@@ -24,7 +26,7 @@ export function WorkspaceSidebar({
|
|||||||
</SidebarHeader>
|
</SidebarHeader>
|
||||||
<SidebarContent>
|
<SidebarContent>
|
||||||
<WorkspaceNavChatList />
|
<WorkspaceNavChatList />
|
||||||
<RecentChatList />
|
{isSidebarOpen && <RecentChatList />}
|
||||||
</SidebarContent>
|
</SidebarContent>
|
||||||
<SidebarFooter>
|
<SidebarFooter>
|
||||||
<WorkspaceNavMenu />
|
<WorkspaceNavMenu />
|
||||||
|
|||||||
Reference in New Issue
Block a user