contextmenu list recoil 추가
This commit is contained in:
parent
44c07e0f93
commit
4324f3d53b
@ -23,7 +23,7 @@ import FlowDirectionSetting from '@/components/floor-plan/modal/flowDirection/Fl
|
||||
import { useCommonUtils } from './common/useCommonUtils'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useCanvasEvent } from '@/hooks/useCanvasEvent'
|
||||
import { contextMenuState } from '@/store/contextMenu'
|
||||
import { contextMenuListState, contextMenuState } from '@/store/contextMenu'
|
||||
import ImageSizeSetting from '@/components/floor-plan/modal/image/ImageSizeSetting'
|
||||
import PanelEdit from '@/components/floor-plan/modal/module/PanelEdit'
|
||||
import DimensionLineSetting from '@/components/floor-plan/modal/dimensionLine/DimensionLineSetting'
|
||||
@ -36,7 +36,7 @@ import CircuitNumberEdit from '@/components/floor-plan/modal/module/CircuitNumbe
|
||||
export function useContextMenu() {
|
||||
const currentMenu = useRecoilValue(currentMenuState) // 현재 메뉴
|
||||
const setContextPopupPosition = useSetRecoilState(contextPopupPositionState) // 현재 메뉴
|
||||
const [contextMenu, setContextMenu] = useState([[]]) // 메뉴.object 별 context menu
|
||||
const [contextMenu, setContextMenu] = useRecoilState(contextMenuListState) // 메뉴.object 별 context menu
|
||||
const [currentContextMenu, setCurrentContextMenu] = useRecoilState(contextPopupState) // 선택한 contextMenu
|
||||
const currentObject = useRecoilValue(currentObjectState)
|
||||
const { getMessage } = useMessage()
|
||||
@ -221,9 +221,10 @@ export function useContextMenu() {
|
||||
if (menu?.fn) {
|
||||
menu.fn()
|
||||
}
|
||||
|
||||
setContextPopupPosition({
|
||||
x: e?.clientX,
|
||||
y: e?.clientY,
|
||||
x: window.innerWidth / 2,
|
||||
y: 180,
|
||||
})
|
||||
setCurrentContextMenu(menu)
|
||||
setQContextMenu({ ...qContextMenu, visible: false })
|
||||
|
||||
@ -9,3 +9,9 @@ export const contextMenuState = atom({
|
||||
},
|
||||
dangerouslyAllowMutability: true,
|
||||
})
|
||||
|
||||
export const contextMenuListState = atom({
|
||||
key: 'contextMenuListState',
|
||||
default: null,
|
||||
dangerouslyAllowMutability: true,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user