modal 버그 수정

This commit is contained in:
minsik 2024-11-04 16:19:20 +09:00
parent 40fa42b19b
commit 45c9abd86a
3 changed files with 9 additions and 9 deletions

View File

@ -8,7 +8,7 @@ import { contextPopupPositionState } from '@/store/popupAtom'
export default function ColorPickerModal(props) {
const contextPopupPosition = useRecoilValue(contextPopupPositionState) //
const { isShow, setIsShow, pos = contextPopupPosition, color = '#ff0000', setColor, id } = props
const { isShow, setIsShow, pos = contextPopupPosition, color = '#ff0000', setColor, id, isConfig = false } = props
const { getMessage } = useMessage()
const [originColor, setOriginColor] = useState(color)
const { closePopup } = usePopup()
@ -29,7 +29,7 @@ export default function ColorPickerModal(props) {
setIsShow(false)
}
console.log(id)
closePopup(id)
closePopup(id, isConfig)
}}
>
닫기
@ -49,7 +49,7 @@ export default function ColorPickerModal(props) {
if (setColor) setColor(originColor)
if (setIsShow) setIsShow(false)
closePopup(id)
closePopup(id, isConfig)
}}
>
{getMessage('common.message.save')}

View File

@ -5,9 +5,7 @@ import { useMessage } from '@/hooks/useMessage'
import { canvasState, dotLineGridSettingState, dotLineIntervalSelector } from '@/store/canvasAtom'
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
import { onlyNumberInputChange } from '@/util/input-utils'
import { fabric } from 'fabric'
import { gridColorState } from '@/store/gridAtom'
import { gridDisplaySelector, settingModalGridOptionsState } from '@/store/settingAtom'
import { settingModalGridOptionsState } from '@/store/settingAtom'
import { useAxios } from '@/hooks/useAxios'
import { useSwal } from '@/hooks/useSwal'
import { usePopup } from '@/hooks/usePopup'
@ -33,7 +31,7 @@ export default function DotLineGrid(props) {
// const [modalOption, setModalOption] = useRecoilState(modalState); //modal state
const [objectNo, setObjectNo] = useState('test123240912001') //
const [close, setClose] = useState(false)
const { id, setIsShow, pos = { x: 840, y: -815 } } = props
const { id, setIsShow, pos = { x: 840, y: -815 }, isConfig = false } = props
const setSettingModalGridOptions = useSetRecoilState(settingModalGridOptionsState)
const canvas = useRecoilValue(canvasState)
@ -142,7 +140,7 @@ export default function DotLineGrid(props) {
await post({ url: `/api/canvas-management/canvas-grid-settings`, data: patternData }).then((res) => {
swalFire({ text: getMessage(res.returnMessage) })
setDotLineGridSettingState({ ...currentSetting })
closePopup(id)
closePopup(id, isConfig)
})
} catch (error) {
swalFire({ text: getMessage(res.returnMessage), icon: 'error' })
@ -213,7 +211,7 @@ export default function DotLineGrid(props) {
className="modal-close"
onClick={() => {
setIsShow(false)
closePopup(id)
closePopup(id, isConfig)
}}
>
닫기

View File

@ -94,6 +94,7 @@ export default function GridOption() {
const dotLineGridProps = {
id: dotLineId,
setIsShow: setShowDotLineGridModal,
isConfig: true,
pos: {
x: 845,
y: 180,
@ -106,6 +107,7 @@ export default function GridOption() {
setColor: setGridColor,
isShow: showColorPickerModal,
setIsShow: setShowColorPickerModal,
isConfig: true,
pos: {
x: 785,
y: 180,