Remove unused usePrism()

This commit is contained in:
Aria Minaei 2022-06-13 15:00:51 +02:00 committed by Aria
parent dc7e5a1128
commit 58bf030aaa

View file

@ -1,5 +1,4 @@
import type {SequenceEditorTree_SheetObject} from '@theatre/studio/panels/SequenceEditorPanel/layout/tree' import type {SequenceEditorTree_SheetObject} from '@theatre/studio/panels/SequenceEditorPanel/layout/tree'
import {usePrism} from '@theatre/react'
import React from 'react' import React from 'react'
import AnyCompositeRow from './AnyCompositeRow' import AnyCompositeRow from './AnyCompositeRow'
import {decideRowByPropType} from './PropWithChildrenRow' import {decideRowByPropType} from './PropWithChildrenRow'
@ -9,28 +8,26 @@ import getStudio from '@theatre/studio/getStudio'
const LeftSheetObjectRow: React.VFC<{ const LeftSheetObjectRow: React.VFC<{
leaf: SequenceEditorTree_SheetObject leaf: SequenceEditorTree_SheetObject
}> = ({leaf}) => { }> = ({leaf}) => {
return usePrism(() => { return (
return ( <AnyCompositeRow
<AnyCompositeRow leaf={leaf}
leaf={leaf} label={leaf.sheetObject.address.objectKey}
label={leaf.sheetObject.address.objectKey} isCollapsed={leaf.isCollapsed}
isCollapsed={leaf.isCollapsed} toggleSelect={() => {
toggleSelect={() => { // set selection to this sheet object on click
// set selection to this sheet object on click getStudio().transaction(({stateEditors}) => {
getStudio().transaction(({stateEditors}) => { stateEditors.studio.historic.panels.outline.selection.set([
stateEditors.studio.historic.panels.outline.selection.set([ leaf.sheetObject,
leaf.sheetObject, ])
]) })
}) }}
}} toggleCollapsed={() =>
toggleCollapsed={() => setCollapsedSheetObjectOrCompoundProp(!leaf.isCollapsed, leaf)
setCollapsedSheetObjectOrCompoundProp(!leaf.isCollapsed, leaf) }
} >
> {leaf.children.map((leaf) => decideRowByPropType(leaf))}
{leaf.children.map((leaf) => decideRowByPropType(leaf))} </AnyCompositeRow>
</AnyCompositeRow> )
)
}, [leaf])
} }
export default LeftSheetObjectRow export default LeftSheetObjectRow