From 98a2589aa87a1bae6586afea83ceb309af8ca939 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 2 Oct 2024 13:19:48 +0900 Subject: [PATCH] fix: control modal head props --- src/components/common/draggable/withDraggable.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/common/draggable/withDraggable.jsx b/src/components/common/draggable/withDraggable.jsx index 81138e2..4da04ff 100644 --- a/src/components/common/draggable/withDraggable.jsx +++ b/src/components/common/draggable/withDraggable.jsx @@ -3,7 +3,7 @@ import { useState } from 'react' import Draggable from 'react-draggable' -export default function WithDraggable({ isShow, children }) { +export default function WithDraggable({ isShow, handle = '', children }) { const [position, setPosition] = useState({ x: 0, y: 0 }) const handleOnDrag = (data) => { @@ -13,7 +13,11 @@ export default function WithDraggable({ isShow, children }) { return ( <> {isShow && ( - handleOnDrag(data)} handle=".modal-header"> + handleOnDrag(data)} + handle={handle === '' ? '.modal-head' : handle} + > {children} )}