diff --git a/packages/editor/src/components/StructureTree/ComponentItemView.tsx b/packages/editor/src/components/StructureTree/ComponentItemView.tsx index a03d86a2..11ca44e0 100644 --- a/packages/editor/src/components/StructureTree/ComponentItemView.tsx +++ b/packages/editor/src/components/StructureTree/ComponentItemView.tsx @@ -6,7 +6,7 @@ type Props = { title: string; isSelected: boolean; onClick: () => void; - onClickRemove: () => void; + onClickRemove?: () => void; noChevron: boolean; isExpanded?: boolean; onToggleExpanded?: () => void; @@ -60,13 +60,15 @@ export const ComponentItemView: React.FC = props => { {title} - } - onClick={onClickRemove} - /> + {onClickRemove ? ( + } + onClick={onClickRemove} + /> + ) : null} ); diff --git a/packages/editor/src/components/StructureTree/StructureTree.tsx b/packages/editor/src/components/StructureTree/StructureTree.tsx index 1c1305f4..26c8b66b 100644 --- a/packages/editor/src/components/StructureTree/StructureTree.tsx +++ b/packages/editor/src/components/StructureTree/StructureTree.tsx @@ -7,7 +7,7 @@ import { } from '../../operations/Operations'; import { ComponentItemView } from './ComponentItemView'; import { ComponentTree } from './ComponentTree'; -import { Text, VStack } from '@chakra-ui/react'; +import { Box, Text, VStack } from '@chakra-ui/react'; export type ChildrenMap = Map; type SlotsMap = Map; @@ -93,8 +93,14 @@ function RootItem() { eventBus.send('operation', new CreateComponentOperation(creatingComponent)); }; return ( - - Root - + + undefined} + isDroppable={true} + noChevron={true} + /> + ); }