초기 position 세팅 수정
This commit is contained in:
parent
dbbb575fdd
commit
b0a9e91d07
@ -1,18 +1,18 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useEffect, useState } from 'react'
|
import { useState } from 'react'
|
||||||
import Draggable from 'react-draggable'
|
import Draggable from 'react-draggable'
|
||||||
|
|
||||||
export default function WithDraggable({ isShow, children, pos, handle = '' }) {
|
export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 }, handle = '' }) {
|
||||||
const [position, setPosition] = useState({ x: 0, y: 0 })
|
const [position, setPosition] = useState(pos)
|
||||||
|
|
||||||
const handleOnDrag = (e, data) => {
|
const handleOnDrag = (e, data) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
setPosition({ x: data.x, y: data.y })
|
setPosition({ x: data.x, y: data.y })
|
||||||
}
|
}
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
setPosition({ ...pos })
|
// setPosition({ ...pos })
|
||||||
}, [])
|
// }, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@ -240,7 +240,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={{ x: 50, y: 230 }}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap lr-2`}>
|
<div className={`modal-pop-wrap lr-2`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('plan.menu.placement.surface.arrangement')} </h1>
|
<h1 className="title">{getMessage('plan.menu.placement.surface.arrangement')} </h1>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user