From b162e2bfc04fbcf1dd2eae5e4f2597fb39b4c970 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 6 Jun 2026 07:50:07 +0700 Subject: [PATCH] webapp: fixes to mobile sheet component on mobile --- .../prompt-box/mobile/SettingsDrawer.tsx | 2 + .../src/components/ui/sheet.tsx | 75 ++++++++++++------- 2 files changed, 51 insertions(+), 26 deletions(-) diff --git a/frontend/apps/artcraft-webapp/src/components/prompt-box/mobile/SettingsDrawer.tsx b/frontend/apps/artcraft-webapp/src/components/prompt-box/mobile/SettingsDrawer.tsx index 3e46077bb9..2038007d6d 100644 --- a/frontend/apps/artcraft-webapp/src/components/prompt-box/mobile/SettingsDrawer.tsx +++ b/frontend/apps/artcraft-webapp/src/components/prompt-box/mobile/SettingsDrawer.tsx @@ -32,6 +32,8 @@ export function SettingsDrawer({
diff --git a/frontend/apps/artcraft-webapp/src/components/ui/sheet.tsx b/frontend/apps/artcraft-webapp/src/components/ui/sheet.tsx index 52e35d8faa..541f041a43 100644 --- a/frontend/apps/artcraft-webapp/src/components/ui/sheet.tsx +++ b/frontend/apps/artcraft-webapp/src/components/ui/sheet.tsx @@ -13,7 +13,7 @@ const SheetOverlay = React.forwardRef< & { +type SheetContentProps = React.ComponentPropsWithoutRef< + typeof DialogPrimitive.Content +> & { side?: "left" | "right" | "top" | "bottom"; + // When the sheet is non-modal (`modal={false}` on Sheet), Radix renders no + // , so we draw our own dimmed backdrop to keep the focus. + // Pass `open` so it can play the same fade in/out via `.ac-sheet-overlay`. + modal?: boolean; + open?: boolean; }; const SheetContent = React.forwardRef< React.ElementRef, SheetContentProps ->(({ side = "right", className, children, ...props }, ref) => ( - - - ( + ( + { side = "right", className, children, modal = true, open, ...props }, + ref, + ) => ( + + {modal ? ( + + ) : ( +
)} - {...props} - > - {children} - - -)); + + {children} + + + ), +); SheetContent.displayName = "SheetContent"; -const SheetHeader = ({ className, ...props }: React.HTMLAttributes) => ( +const SheetHeader = ({ + className, + ...props +}: React.HTMLAttributes) => (
);