🚨chore: Reformat code
This commit is contained in:
parent
24db76fa01
commit
9dc0c392ab
@ -1,34 +0,0 @@
|
|||||||
import { useEvent } from '@/hooks/useEvent'
|
|
||||||
import { createContext, useState } from 'react'
|
|
||||||
|
|
||||||
export const EventContext = createContext({})
|
|
||||||
|
|
||||||
const EventProvider = ({ children }) => {
|
|
||||||
const {
|
|
||||||
addDocumentEventListener,
|
|
||||||
addCanvasMouseEventListener,
|
|
||||||
addTargetMouseEventListener,
|
|
||||||
removeAllMouseEventListeners,
|
|
||||||
removeAllDocumentEventListeners,
|
|
||||||
removeDocumentEvent,
|
|
||||||
removeMouseEvent,
|
|
||||||
removeMouseLine,
|
|
||||||
initEvent,
|
|
||||||
} = useEvent()
|
|
||||||
|
|
||||||
const [value, setValue] = useState({
|
|
||||||
addDocumentEventListener,
|
|
||||||
addCanvasMouseEventListener,
|
|
||||||
addTargetMouseEventListener,
|
|
||||||
removeAllMouseEventListeners,
|
|
||||||
removeAllDocumentEventListeners,
|
|
||||||
removeDocumentEvent,
|
|
||||||
removeMouseEvent,
|
|
||||||
removeMouseLine,
|
|
||||||
initEvent,
|
|
||||||
})
|
|
||||||
|
|
||||||
return <EventContext.Provider value={value}>{children}</EventContext.Provider>
|
|
||||||
}
|
|
||||||
|
|
||||||
export default EventProvider
|
|
||||||
@ -15,7 +15,6 @@ import { MENU } from '@/common/common'
|
|||||||
import PanelBatchStatistics from '@/components/floor-plan/modal/panelBatch/PanelBatchStatistics'
|
import PanelBatchStatistics from '@/components/floor-plan/modal/panelBatch/PanelBatchStatistics'
|
||||||
import { totalDisplaySelector } from '@/store/settingAtom'
|
import { totalDisplaySelector } from '@/store/settingAtom'
|
||||||
import ImgLoad from '@/components/floor-plan/modal/ImgLoad'
|
import ImgLoad from '@/components/floor-plan/modal/ImgLoad'
|
||||||
import { EventContext } from '@/app/floor-plan/EventProvider'
|
|
||||||
|
|
||||||
export default function CanvasFrame() {
|
export default function CanvasFrame() {
|
||||||
const canvasRef = useRef(null)
|
const canvasRef = useRef(null)
|
||||||
|
|||||||
@ -5,12 +5,10 @@ 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'
|
||||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||||
import { useRef, useState, useEffect, useContext } from 'react'
|
import { useRef, useState } from 'react'
|
||||||
import { useObjectBatch } from '@/hooks/object/useObjectBatch'
|
import { useObjectBatch } from '@/hooks/object/useObjectBatch'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
|
||||||
import { BATCH_TYPE, POLYGON_TYPE } from '@/common/common'
|
import { BATCH_TYPE, POLYGON_TYPE } from '@/common/common'
|
||||||
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
||||||
import { EventContext } from '@/app/floor-plan/EventProvider'
|
|
||||||
|
|
||||||
export default function SizeSetting(props) {
|
export default function SizeSetting(props) {
|
||||||
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { useContext, useEffect, useState } from 'react'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
|
||||||
import { canvasState } from '@/store/canvasAtom'
|
import { canvasState } from '@/store/canvasAtom'
|
||||||
import { rectToPolygon, setSurfaceShapePattern } from '@/util/canvas-util'
|
import { rectToPolygon, setSurfaceShapePattern } from '@/util/canvas-util'
|
||||||
import { roofDisplaySelector } from '@/store/settingAtom'
|
import { roofDisplaySelector } from '@/store/settingAtom'
|
||||||
@ -10,9 +9,7 @@ import { moduleSetupSurfaceState, moduleIsSetupState } from '@/store/canvasAtom'
|
|||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { POLYGON_TYPE, BATCH_TYPE } from '@/common/common'
|
import { POLYGON_TYPE, BATCH_TYPE } from '@/common/common'
|
||||||
import * as turf from '@turf/turf'
|
import * as turf from '@turf/turf'
|
||||||
import { EventContext } from '@/app/floor-plan/EventProvider'
|
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { useMainContentsController } from '../main/useMainContentsController'
|
|
||||||
|
|
||||||
export function useModuleBasicSetting() {
|
export function useModuleBasicSetting() {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useContext, useEffect, useRef } from 'react'
|
import { useEffect, useRef } from 'react'
|
||||||
import { distanceBetweenPoints } from '@/util/canvas-util'
|
import { distanceBetweenPoints } from '@/util/canvas-util'
|
||||||
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||||
import {
|
import {
|
||||||
@ -31,7 +31,6 @@ import { fabric } from 'fabric'
|
|||||||
import { outlineDisplaySelector } from '@/store/settingAtom'
|
import { outlineDisplaySelector } from '@/store/settingAtom'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import PropertiesSetting from '@/components/floor-plan/modal/outerlinesetting/PropertiesSetting'
|
import PropertiesSetting from '@/components/floor-plan/modal/outerlinesetting/PropertiesSetting'
|
||||||
import { EventContext } from '@/app/floor-plan/EventProvider'
|
|
||||||
|
|
||||||
//외벽선 그리기
|
//외벽선 그리기
|
||||||
export function useOuterLineWall(id, propertiesId) {
|
export function useOuterLineWall(id, propertiesId) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user