From f413d29fa16d5ea39391f5ec421745e441b1f2fd Mon Sep 17 00:00:00 2001 From: mkfain Date: Sun, 17 May 2026 20:30:45 -0500 Subject: [PATCH] Remove duplicate close X in mobile hamburger menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mobile nav drawer in TopNav has its own X button inside the panel header, but SheetContent was also rendering the shadcn primitive close button just outside the panel — two X buttons for the same sheet. Add an opt-in `hideClose` prop to SheetContent and set it on the TopNav drawer. Other Sheet consumers (MobileDrawer, etc.) keep the default built-in close. --- src/components/TopNav.tsx | 2 +- src/components/ui/sheet.tsx | 37 +++++++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/components/TopNav.tsx b/src/components/TopNav.tsx index 2d5171e0..76ff9d70 100644 --- a/src/components/TopNav.tsx +++ b/src/components/TopNav.tsx @@ -88,7 +88,7 @@ export function TopNav() { {/* Mobile drawer */} - +
, - VariantProps { } + VariantProps { + /** + * When true, suppress the built-in close (X) button. Use this when the + * sheet content renders its own close affordance to avoid duplicate + * dismiss buttons. + */ + hideClose?: boolean; +} const SheetContent = React.forwardRef< React.ElementRef, SheetContentProps ->(({ side = "right", className, children, ...props }, ref) => ( +>(({ side = "right", className, children, hideClose = false, ...props }, ref) => ( {children} - - - Close - + {!hideClose && ( + + + Close + + )} ))