Fix put back sidebar trigger

This commit is contained in:
Émile Ré
2025-03-14 16:54:30 +04:00
parent c9b58010f7
commit 4123db21c5
4 changed files with 26 additions and 15 deletions

View File

@@ -21,12 +21,14 @@ export function AppSidebarShell({
}: AppSidebarShellProps) {
return (
<Sidebar variant="sidebar" {...props}>
<SidebarHeader>{organizationSwitcher}</SidebarHeader>
<SidebarContent>
{navMain}
<NavSecondary className="mt-auto" />
</SidebarContent>
<SidebarFooter>{navUser}</SidebarFooter>
<div className="p-4">
<SidebarHeader>{organizationSwitcher}</SidebarHeader>
<SidebarContent>
{navMain}
<NavSecondary className="mt-auto" />
</SidebarContent>
<SidebarFooter>{navUser}</SidebarFooter>
</div>
</Sidebar>
);
}

View File

@@ -1,7 +1,7 @@
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { VariantProps, cva } from "class-variance-authority";
import { PanelLeft } from "lucide-react";
import { PanelLeft, PanelLeftClose } from "lucide-react";
import { useIsMobile } from "@/hooks/use-mobile";
import { cn } from "@/lib/utils";
@@ -261,7 +261,7 @@ const SidebarTrigger = React.forwardRef<
React.ElementRef<typeof Button>,
React.ComponentProps<typeof Button>
>(({ className, onClick, ...props }, ref) => {
const { toggleSidebar } = useSidebar();
const { toggleSidebar, open } = useSidebar();
return (
<Button
@@ -276,7 +276,11 @@ const SidebarTrigger = React.forwardRef<
}}
{...props}
>
<PanelLeft />
{open ? (
<PanelLeftClose fontWeight={400} className="text-gray-500" />
) : (
<PanelLeft fontWeight={400} className="text-gray-500" />
)}
<span className="sr-only">Toggle Sidebar</span>
</Button>
);