From 687bf534080c9eaba1c5e8d42c7e398207ab6735 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Wed, 4 Jan 2023 20:53:47 +0100 Subject: [PATCH] Use Atom instead of Box --- .../DetailCompoundPropEditor.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/theatre/studio/src/panels/DetailPanel/DeterminePropEditorForDetail/DetailCompoundPropEditor.tsx b/theatre/studio/src/panels/DetailPanel/DeterminePropEditorForDetail/DetailCompoundPropEditor.tsx index c15087a..8e7ca48 100644 --- a/theatre/studio/src/panels/DetailPanel/DeterminePropEditorForDetail/DetailCompoundPropEditor.tsx +++ b/theatre/studio/src/panels/DetailPanel/DeterminePropEditorForDetail/DetailCompoundPropEditor.tsx @@ -4,7 +4,7 @@ import type { } from '@theatre/core/propTypes' import {isPropConfigComposite} from '@theatre/shared/propTypes/utils' import type {$FixMe} from '@theatre/shared/utils/types' -import {Box, getPointerParts} from '@theatre/dataverse' +import {Atom, getPointerParts} from '@theatre/dataverse' import type {Pointer} from '@theatre/dataverse' import last from 'lodash-es/last' import {darken, transparentize} from 'polished' @@ -177,7 +177,7 @@ function DetailCompoundPropEditor< useLayoutEffect(() => { if (!collapsedMap.has(globalPointerPath)) { - collapsedMap.set(globalPointerPath, new Box(isVectorProp(propConfig))) + collapsedMap.set(globalPointerPath, new Atom(isVectorProp(propConfig))) } }, []) @@ -186,7 +186,7 @@ function DetailCompoundPropEditor< const isCollapsed = usePrism(() => { const box = collapsedMap.get(globalPointerPath) - return box ? val(box.derivation) : isVectorProp(propConfig) + return box ? val(box.pointer) : isVectorProp(propConfig) }, [box]) return ( @@ -263,4 +263,4 @@ function DetailCompoundPropEditor< export default React.memo(DetailCompoundPropEditor) -const collapsedMap = new Map>() +const collapsedMap = new Map>()