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