Compare commits
No commits in common. "ea59dd85235f40f9981a5776af6cdc3496dff65d" and "29712ce74c54df82370f22183e2ca940011a0445" have entirely different histories.
ea59dd8523
...
29712ce74c
@ -4,7 +4,6 @@ import { usePopup } from '@/hooks/usePopup'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||
import { useState } from 'react'
|
||||
import Image from 'next/image'
|
||||
import { currentObjectState } from '@/store/canvasAtom'
|
||||
import { useAuxiliaryDrawing } from '@/hooks/roofcover/useAuxiliaryDrawing'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
@ -23,8 +22,6 @@ export default function AuxiliaryEdit(props) {
|
||||
const [arrow2, setArrow2] = useState(null)
|
||||
const currentObject = useRecoilValue(currentObjectState)
|
||||
const { swalFire } = useSwal()
|
||||
const [useCalcPad, setUseCalcPad] = useState(false)
|
||||
const disableKeypad = !useCalcPad
|
||||
const handleSave = () => {
|
||||
if ((!arrow1 && !arrow2) || (+verticalSize === 0 && +horizonSize === 0)) {
|
||||
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
|
||||
@ -78,7 +75,6 @@ export default function AuxiliaryEdit(props) {
|
||||
className="input-origin block"
|
||||
value={verticalSize}
|
||||
onChange={(value) => setVerticalSize(value)}
|
||||
disableKeypad={disableKeypad}
|
||||
options={{
|
||||
allowNegative: false,
|
||||
allowDecimal: false
|
||||
@ -113,7 +109,6 @@ export default function AuxiliaryEdit(props) {
|
||||
className="input-origin block"
|
||||
value={horizonSize}
|
||||
onChange={(value) => setHorizonSize(value)}
|
||||
disableKeypad={disableKeypad}
|
||||
options={{
|
||||
allowNegative: false,
|
||||
allowDecimal: false
|
||||
@ -141,10 +136,7 @@ export default function AuxiliaryEdit(props) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<div className="grid-btn-wrap">
|
||||
<button className="btn-frame modal act" onClick={handleSave}>
|
||||
{getMessage('modal.common.save')}
|
||||
</button>
|
||||
|
||||
@ -5,7 +5,6 @@ import { useRecoilValue } from 'recoil'
|
||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||
import { canvasState, currentObjectState } from '@/store/canvasAtom'
|
||||
import { useEffect, useState } from 'react'
|
||||
import Image from 'next/image'
|
||||
import Big from 'big.js'
|
||||
import { calcLineActualSize, calcLinePlaneSize } from '@/util/qpolygon-utils'
|
||||
import { normalizeDigits } from '@/util/input-utils'
|
||||
@ -22,8 +21,6 @@ export default function AuxiliarySize(props) {
|
||||
const { closePopup } = usePopup()
|
||||
const currentObject = useRecoilValue(currentObjectState)
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const [useCalcPad, setUseCalcPad] = useState(false)
|
||||
const disableKeypad = !useCalcPad
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
@ -144,7 +141,6 @@ export default function AuxiliarySize(props) {
|
||||
value={value1}
|
||||
onChange={handleInput}
|
||||
readOnly={checkedRadio !== 1}
|
||||
disableKeypad={disableKeypad}
|
||||
options={{
|
||||
allowNegative: false,
|
||||
allowDecimal: false
|
||||
@ -177,7 +173,6 @@ export default function AuxiliarySize(props) {
|
||||
value={value2}
|
||||
onChange={handleInput}
|
||||
readOnly={checkedRadio !== 2}
|
||||
disableKeypad={disableKeypad}
|
||||
options={{
|
||||
allowNegative: false,
|
||||
allowDecimal: false
|
||||
@ -187,10 +182,7 @@ export default function AuxiliarySize(props) {
|
||||
<span className="thin">mm</span>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<div className="grid-btn-wrap">
|
||||
<button className="btn-frame modal act" onClick={handleSave}>
|
||||
{getMessage('modal.common.save')}
|
||||
</button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user