From 264a90b0be7d17847112aea4449780a6383ef9a5 Mon Sep 17 00:00:00 2001 From: Bowen Tan Date: Tue, 2 Nov 2021 14:55:47 +0800 Subject: [PATCH] fix component tree overflow style --- .../StructureTree/ComponentItemView.tsx | 43 ++++++++++++------- .../StructureTree/ComponentTree.tsx | 2 +- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/packages/editor/src/components/StructureTree/ComponentItemView.tsx b/packages/editor/src/components/StructureTree/ComponentItemView.tsx index 1183f0d3..0e7b6e77 100644 --- a/packages/editor/src/components/StructureTree/ComponentItemView.tsx +++ b/packages/editor/src/components/StructureTree/ComponentItemView.tsx @@ -1,4 +1,10 @@ -import { ArrowDownIcon, ArrowUpIcon, ChevronDownIcon, ChevronRightIcon, DeleteIcon } from '@chakra-ui/icons'; +import { + ArrowDownIcon, + ArrowUpIcon, + ChevronDownIcon, + ChevronRightIcon, + DeleteIcon, +} from '@chakra-ui/icons'; import { Box, HStack, IconButton, Text } from '@chakra-ui/react'; import { useState } from 'react'; @@ -28,7 +34,7 @@ export const ComponentItemView: React.FC = props => { isDroppable, isSortable = false, onMoveUp, - onMoveDown + onMoveDown, } = props; const [isDragOver, setIsDragOver] = useState(false); @@ -63,23 +69,28 @@ export const ComponentItemView: React.FC = props => { > {noChevron ? null : expandIcon} - + {title} - + {onClickRemove ? ( - - } - onClick={onClickRemove} - /> - + } + onClick={onClickRemove} + /> ) : null} {isSortable ? ( - + <> = props => { icon={} onClick={onMoveDown} /> - + ) : null} - + ); diff --git a/packages/editor/src/components/StructureTree/ComponentTree.tsx b/packages/editor/src/components/StructureTree/ComponentTree.tsx index 92db4148..d4cd20b3 100644 --- a/packages/editor/src/components/StructureTree/ComponentTree.tsx +++ b/packages/editor/src/components/StructureTree/ComponentTree.tsx @@ -66,7 +66,7 @@ export const ComponentTree: React.FC = props => { ); return ( - + {/* although component can have multiple slots, but for now, most components have only one slot so we hide slot name to save more view area */} {slots.length > 1 ? slotName : null}