サイズ変更 - 계산기 토클버튼 추가

This commit is contained in:
ysCha 2026-03-19 17:19:10 +09:00
parent b10fc27014
commit bc389e3a3c

View File

@ -1,6 +1,7 @@
'use client' 'use client'
import { useRecoilValue } from 'recoil' import { useRecoilValue } from 'recoil'
import Image from 'next/image'
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable' import WithDraggable from '@/components/common/draggable/WithDraggable'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
@ -23,6 +24,8 @@ export default function SizeSetting(props) {
const heightRef = useRef(null) const heightRef = useRef(null)
const [width, setWidth] = useState(target?.width ? (target.width * 10).toFixed() : 0) const [width, setWidth] = useState(target?.width ? (target.width * 10).toFixed() : 0)
const [height, setHeight] = useState(target?.height ? (target.height * 10) : 0) const [height, setHeight] = useState(target?.height ? (target.height * 10) : 0)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
// const { initEvent } = useEvent() // const { initEvent } = useEvent()
// const { initEvent } = useContext(EventContext) // const { initEvent } = useContext(EventContext)
@ -72,6 +75,7 @@ export default function SizeSetting(props) {
value={width} value={width}
ref={widthRef} ref={widthRef}
onChange={(value) => setWidth(value)} onChange={(value) => setWidth(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -99,6 +103,7 @@ export default function SizeSetting(props) {
value={height} value={height}
ref={heightRef} ref={heightRef}
onChange={(value) => setHeight(value)} onChange={(value) => setHeight(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -117,7 +122,10 @@ export default function SizeSetting(props) {
</div> </div>
</div> </div>
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={() => handleReSizeObject(id)}> <button className="btn-frame modal act" onClick={() => handleReSizeObject(id)}>
{getMessage('write')} {getMessage('write')}
</button> </button>