From 3b44741cf9a374760bc0c41735929b833331d082 Mon Sep 17 00:00:00 2001 From: Yuichi Ohneda Date: Wed, 1 May 2024 23:08:37 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20fix(dialog):=20showCloseButton?= =?UTF-8?q?=20Prop=20Warning=20in=20DialogContent=20Component=20(#2597)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix DialogPrimitive.Content to not pass a showCloseButton property that does not exist in it to avoid outputting a warning. --- client/src/components/ui/Dialog.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/src/components/ui/Dialog.tsx b/client/src/components/ui/Dialog.tsx index bb0d3aeb05..ef2cae96f3 100644 --- a/client/src/components/ui/Dialog.tsx +++ b/client/src/components/ui/Dialog.tsx @@ -40,9 +40,8 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; const DialogContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { showCloseButton?: boolean } ->(({ className, children = true, ...props }, ref) => { +>(({ className, children = true, showCloseButton = true, ...props }, ref) => { const isSmallScreen = useMediaQuery('(max-width: 768px)'); - return ( @@ -59,10 +58,12 @@ const DialogContent = React.forwardRef< {...props} > {children} - - - Close - + {showCloseButton && ( + + + Close + + )} );