WithDraggablePanel 관련 부분 삭제
This commit is contained in:
parent
b9f4cf69a4
commit
197c107e7a
@ -3,16 +3,7 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import Draggable from 'react-draggable'
|
import Draggable from 'react-draggable'
|
||||||
|
|
||||||
export default function WithDraggable({
|
export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 }, handle = '', className = '', hasFooter = true, isHidden = false }) {
|
||||||
isShow,
|
|
||||||
children,
|
|
||||||
pos = { x: 0, y: 0 },
|
|
||||||
handle = '',
|
|
||||||
className = '',
|
|
||||||
isModal = true,
|
|
||||||
hasFooter = true,
|
|
||||||
isHidden = false,
|
|
||||||
}) {
|
|
||||||
const [position, setPosition] = useState(pos)
|
const [position, setPosition] = useState(pos)
|
||||||
|
|
||||||
const handleOnDrag = (e, data) => {
|
const handleOnDrag = (e, data) => {
|
||||||
@ -31,14 +22,10 @@ export default function WithDraggable({
|
|||||||
onDrag={(e, data) => handleOnDrag(e, data)}
|
onDrag={(e, data) => handleOnDrag(e, data)}
|
||||||
handle={handle === '' ? '.modal-handle' : handle}
|
handle={handle === '' ? '.modal-handle' : handle}
|
||||||
>
|
>
|
||||||
{isModal ? (
|
<div className={`modal-pop-wrap ${className}`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
|
||||||
<div className={`modal-pop-wrap ${className}`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
|
{children}
|
||||||
{children}
|
{hasFooter && <WithDraggableFooter />}
|
||||||
{hasFooter && <WithDraggableFooter />}
|
</div>
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<>{children}</>
|
|
||||||
)}
|
|
||||||
</Draggable>
|
</Draggable>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
@ -68,15 +55,10 @@ function WithDraggableBody({ children }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function WithDraggablePanel({ children }) {
|
|
||||||
return <>{children}</>
|
|
||||||
}
|
|
||||||
|
|
||||||
function WithDraggableFooter() {
|
function WithDraggableFooter() {
|
||||||
return <div className="modal-foot modal-handle"></div>
|
return <div className="modal-foot modal-handle"></div>
|
||||||
}
|
}
|
||||||
|
|
||||||
WithDraggable.Header = WithDraggableHeader
|
WithDraggable.Header = WithDraggableHeader
|
||||||
WithDraggable.Body = WithDraggableBody
|
WithDraggable.Body = WithDraggableBody
|
||||||
WithDraggable.Panel = WithDraggablePanel
|
|
||||||
WithDraggable.Footer = WithDraggableFooter
|
WithDraggable.Footer = WithDraggableFooter
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user