From aa7c7dfd41e37465ca761d834f5ab90e1b04334c Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Tue, 28 Oct 2025 09:35:57 +0900 Subject: (김준회) ui/dialog.tsx 롤백, 외부클릭 닫힘 이벤트만 중단처리 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ui/dialog.tsx | 100 +++++++++++------------------------------------ 1 file changed, 23 insertions(+), 77 deletions(-) (limited to 'components') diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index 975f3a39..ead9be5d 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -2,11 +2,10 @@ import * as React from "react" import * as DialogPrimitive from "@radix-ui/react-dialog" -import { X, Minus, Plus } from "lucide-react" +import { X } from "lucide-react" import { cn } from "@/lib/utils" - const Dialog = DialogPrimitive.Root const DialogTrigger = DialogPrimitive.Trigger @@ -32,81 +31,28 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName const DialogContent = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef & { - opacityControl?: boolean - } ->(({ className, children, opacityControl = true, ...props }, ref) => { - const [opacity, setOpacity] = React.useState(1) - - const increaseOpacity = () => setOpacity(prev => Math.min(1, prev + 0.1)) - const decreaseOpacity = () => setOpacity(prev => Math.max(0.1, prev - 0.1)) - - return ( - - - e.preventDefault()} // 바깥 클릭으로 닫히는 기능 제거 - {...props} - > -
- {/* 고정 헤더 영역 */} -
- {/* 왼쪽: 빈 공간 */} -
- {/* 드래그 기능 제거됨 */} -
- - {/* 중앙: 투명도 조절 */} -
- {opacityControl && ( -
- - - {Math.round(opacity * 100)}% - - -
- )} -
- - {/* 오른쪽: 닫기 버튼 */} -
- - - Close - -
-
- - {/* 스크롤 가능한 컨텐츠 영역 */} -
- {children} -
-
-
-
- ) -}) + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + e.preventDefault()} + {...props} + > + {children} + + + Close + + + +)) DialogContent.displayName = DialogPrimitive.Content.displayName const DialogHeader = ({ -- cgit v1.2.3