WithDraggablePanel 관련 부분 삭제

This commit is contained in:
김민식 2025-03-14 14:59:07 +09:00
parent b9f4cf69a4
commit 197c107e7a

View File

@ -3,16 +3,7 @@
import { useState } from 'react'
import Draggable from 'react-draggable'
export default function WithDraggable({
isShow,
children,
pos = { x: 0, y: 0 },
handle = '',
className = '',
isModal = true,
hasFooter = true,
isHidden = false,
}) {
export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 }, handle = '', className = '', hasFooter = true, isHidden = false }) {
const [position, setPosition] = useState(pos)
const handleOnDrag = (e, data) => {
@ -31,14 +22,10 @@ export default function WithDraggable({
onDrag={(e, data) => handleOnDrag(e, data)}
handle={handle === '' ? '.modal-handle' : handle}
>
{isModal ? (
<div className={`modal-pop-wrap ${className}`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
{children}
{hasFooter && <WithDraggableFooter />}
</div>
) : (
<>{children}</>
)}
<div className={`modal-pop-wrap ${className}`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
{children}
{hasFooter && <WithDraggableFooter />}
</div>
</Draggable>
)}
</>
@ -68,15 +55,10 @@ function WithDraggableBody({ children }) {
)
}
function WithDraggablePanel({ children }) {
return <>{children}</>
}
function WithDraggableFooter() {
return <div className="modal-foot modal-handle"></div>
}
WithDraggable.Header = WithDraggableHeader
WithDraggable.Body = WithDraggableBody
WithDraggable.Panel = WithDraggablePanel
WithDraggable.Footer = WithDraggableFooter