From ad8d176c0084745f134dea9384eda91987475834 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Tue, 29 Jun 2021 17:07:08 +0200 Subject: [PATCH] Chore: Small refactors --- theatre/studio/src/panels/BasePanel/PanelDragZone.tsx | 2 +- theatre/studio/src/panels/BasePanel/PanelResizeHandle.tsx | 2 +- .../panels/ObjectEditorPanel/propEditors/NumberPropEditor.tsx | 2 +- .../Right/BasicKeyframedTrack/KeyframeEditor/Connector.tsx | 2 +- .../DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx | 2 +- .../DopeSheet/Right/DopeSheetSelectionView.tsx | 2 +- .../DopeSheet/Right/HorizontallyScrollableArea.tsx | 2 +- .../GraphEditor/BasicKeyframedTrack/KeyframeEditor/Curve.tsx | 2 +- .../BasicKeyframedTrack/KeyframeEditor/CurveHandle.tsx | 2 +- .../GraphEditor/BasicKeyframedTrack/KeyframeEditor/Dot.tsx | 2 +- .../src/panels/SequenceEditorPanel/RightOverlay/Playhead.tsx | 2 +- .../src/utils/react => studio/src/utils}/useRefAndState.ts | 0 12 files changed, 11 insertions(+), 11 deletions(-) rename theatre/{shared/src/utils/react => studio/src/utils}/useRefAndState.ts (100%) diff --git a/theatre/studio/src/panels/BasePanel/PanelDragZone.tsx b/theatre/studio/src/panels/BasePanel/PanelDragZone.tsx index 5aac18d..c5ccca7 100644 --- a/theatre/studio/src/panels/BasePanel/PanelDragZone.tsx +++ b/theatre/studio/src/panels/BasePanel/PanelDragZone.tsx @@ -1,4 +1,4 @@ -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import type {$IntentionalAny} from '@theatre/shared/utils/types' import getStudio from '@theatre/studio/getStudio' import type {CommitOrDiscard} from '@theatre/studio/StudioStore/StudioStore' diff --git a/theatre/studio/src/panels/BasePanel/PanelResizeHandle.tsx b/theatre/studio/src/panels/BasePanel/PanelResizeHandle.tsx index 986a973..8082fd6 100644 --- a/theatre/studio/src/panels/BasePanel/PanelResizeHandle.tsx +++ b/theatre/studio/src/panels/BasePanel/PanelResizeHandle.tsx @@ -1,4 +1,4 @@ -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import type {$IntentionalAny} from '@theatre/shared/utils/types' import getStudio from '@theatre/studio/getStudio' import type {CommitOrDiscard} from '@theatre/studio/StudioStore/StudioStore' diff --git a/theatre/studio/src/panels/ObjectEditorPanel/propEditors/NumberPropEditor.tsx b/theatre/studio/src/panels/ObjectEditorPanel/propEditors/NumberPropEditor.tsx index 1cd58a7..13e3a94 100644 --- a/theatre/studio/src/panels/ObjectEditorPanel/propEditors/NumberPropEditor.tsx +++ b/theatre/studio/src/panels/ObjectEditorPanel/propEditors/NumberPropEditor.tsx @@ -2,7 +2,7 @@ import type {PropTypeConfig_Number} from '@theatre/shared/propTypes' import type SheetObject from '@theatre/core/sheetObjects/SheetObject' import BasicNumberEditor from '@theatre/studio/uiComponents/BasicNumberEditor' import useContextMenu from '@theatre/studio/uiComponents/simpleContextMenu/useContextMenu' -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import {getPointerParts} from '@theatre/dataverse' import {last} from 'lodash-es' import React from 'react' diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Connector.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Connector.tsx index 90f1814..3db3bbb 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Connector.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Connector.tsx @@ -2,7 +2,7 @@ import getStudio from '@theatre/studio/getStudio' import type {CommitOrDiscard} from '@theatre/studio/StudioStore/StudioStore' import useContextMenu from '@theatre/studio/uiComponents/simpleContextMenu/useContextMenu' import useDrag from '@theatre/studio/uiComponents/useDrag' -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import {val} from '@theatre/dataverse' import {lighten} from 'polished' import React from 'react' diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx index d74ad35..88b6725 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx @@ -6,7 +6,7 @@ import getStudio from '@theatre/studio/getStudio' import type {CommitOrDiscard} from '@theatre/studio/StudioStore/StudioStore' import useContextMenu from '@theatre/studio/uiComponents/simpleContextMenu/useContextMenu' import useDrag from '@theatre/studio/uiComponents/useDrag' -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import {val} from '@theatre/dataverse' import {lighten} from 'polished' import React, {useMemo, useRef} from 'react' diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetSelectionView.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetSelectionView.tsx index 39e6ae0..2a7269f 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetSelectionView.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetSelectionView.tsx @@ -4,7 +4,7 @@ import useDrag from '@theatre/studio/uiComponents/useDrag' import useKeyDown from '@theatre/studio/uiComponents/useKeyDown' import useValToAtom from '@theatre/studio/uiComponents/useValToAtom' import mutableSetDeep from '@theatre/shared/utils/mutableSetDeep' -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import {usePrism} from '@theatre/dataverse-react' import type {$IntentionalAny} from '@theatre/shared/utils/types' import type {Pointer} from '@theatre/dataverse' diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/HorizontallyScrollableArea.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/HorizontallyScrollableArea.tsx index d49ae78..41070c2 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/HorizontallyScrollableArea.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/HorizontallyScrollableArea.tsx @@ -1,7 +1,7 @@ import type Sequence from '@theatre/core/sequences/Sequence' import type {SequenceEditorPanelLayout} from '@theatre/studio/panels/SequenceEditorPanel/layout/layout' import useDrag from '@theatre/studio/uiComponents/useDrag' -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import {usePrism} from '@theatre/dataverse-react' import type {Pointer} from '@theatre/dataverse' import {prism, val} from '@theatre/dataverse' diff --git a/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/Curve.tsx b/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/Curve.tsx index a9cff5e..a611af7 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/Curve.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/Curve.tsx @@ -1,6 +1,6 @@ import getStudio from '@theatre/studio/getStudio' import useContextMenu from '@theatre/studio/uiComponents/simpleContextMenu/useContextMenu' -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import React from 'react' import styled from 'styled-components' import type KeyframeEditor from './KeyframeEditor' diff --git a/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/CurveHandle.tsx b/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/CurveHandle.tsx index dd2acec..929700b 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/CurveHandle.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/CurveHandle.tsx @@ -3,7 +3,7 @@ import getStudio from '@theatre/studio/getStudio' import type {CommitOrDiscard} from '@theatre/studio/StudioStore/StudioStore' import useContextMenu from '@theatre/studio/uiComponents/simpleContextMenu/useContextMenu' import useDrag from '@theatre/studio/uiComponents/useDrag' -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import type {VoidFn} from '@theatre/shared/utils/types' import {val} from '@theatre/dataverse' import {clamp} from 'lodash-es' diff --git a/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/Dot.tsx b/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/Dot.tsx index e1d68ed..8dff254 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/Dot.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/Dot.tsx @@ -3,7 +3,7 @@ import getStudio from '@theatre/studio/getStudio' import type {CommitOrDiscard} from '@theatre/studio/StudioStore/StudioStore' import useContextMenu from '@theatre/studio/uiComponents/simpleContextMenu/useContextMenu' import useDrag from '@theatre/studio/uiComponents/useDrag' -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import type {VoidFn} from '@theatre/shared/utils/types' import {val} from '@theatre/dataverse' import React, {useMemo, useRef} from 'react' diff --git a/theatre/studio/src/panels/SequenceEditorPanel/RightOverlay/Playhead.tsx b/theatre/studio/src/panels/SequenceEditorPanel/RightOverlay/Playhead.tsx index 36688d2..b2ba2bb 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/RightOverlay/Playhead.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/RightOverlay/Playhead.tsx @@ -2,7 +2,7 @@ import type Sequence from '@theatre/core/sequences/Sequence' import type {SequenceEditorPanelLayout} from '@theatre/studio/panels/SequenceEditorPanel/layout/layout' import RoomToClick from '@theatre/studio/uiComponents/RoomToClick' import useDrag from '@theatre/studio/uiComponents/useDrag' -import useRefAndState from '@theatre/shared/utils/react/useRefAndState' +import useRefAndState from '@theatre/studio/utils/useRefAndState' import {usePrism} from '@theatre/dataverse-react' import type {$IntentionalAny} from '@theatre/shared/utils/types' import type {Pointer} from '@theatre/dataverse' diff --git a/theatre/shared/src/utils/react/useRefAndState.ts b/theatre/studio/src/utils/useRefAndState.ts similarity index 100% rename from theatre/shared/src/utils/react/useRefAndState.ts rename to theatre/studio/src/utils/useRefAndState.ts