@@ -38,6 +38,7 @@ const ItemWrapper = styled.div`
38
38
}
39
39
.module-container {
40
40
display: flex;
41
+ width: 195px;
41
42
}
42
43
.module-icon {
43
44
margin-right: 4px;
@@ -167,6 +168,7 @@ interface ModuleItemProps {
167
168
setSelectedType : ( id : boolean ) => void ;
168
169
resComp : NodeType ;
169
170
id : string ;
171
+ $level : number ;
170
172
}
171
173
172
174
function ModuleItem ( props : ModuleItemProps ) {
@@ -179,7 +181,8 @@ function ModuleItem(props: ModuleItemProps) {
179
181
selectedType,
180
182
setSelectedType,
181
183
resComp,
182
- id
184
+ id,
185
+ $level,
183
186
} = props ;
184
187
const dispatch = useDispatch ( ) ;
185
188
const type = resComp . isFolder ;
@@ -243,8 +246,9 @@ function ModuleItem(props: ModuleItemProps) {
243
246
>
244
247
< div className = "module-container" >
245
248
< ModuleDocIcon className = "module-icon" />
246
- < div style = { { flexGrow : 1 , marginRight : "8px" , width : "calc(100% - 62px)" } } >
247
- < EditText
249
+ < div style = { { flexGrow : 1 , maxWidth : 174 - $level * 10 } } >
250
+ < EditText
251
+ style = { { width : "100%" } }
248
252
text = { meta . name }
249
253
forceClickIcon = { false }
250
254
disabled = { ! isSelected || readOnly || isOverlay }
@@ -268,7 +272,7 @@ const HighlightBorder = styled.div<{ $active: boolean; $foldable: boolean; $leve
268
272
max-width: 100%;
269
273
flex: 1;
270
274
display: flex;
271
- padding-left: ${ ( props ) => props . $level * 20 + ( props . $foldable ? 0 : 14 ) } px;
275
+ padding-left: ${ ( props ) => props . $level * 10 + ( props . $foldable ? 0 : 14 ) } px;
272
276
border-radius: 4px;
273
277
border: 1px solid ${ ( props ) => ( props . $active ? BorderActiveColor : "transparent" ) } ;
274
278
align-items: center;
@@ -479,7 +483,8 @@ function ModuleSidebarItem(props: ModuleSidebarItemProps) {
479
483
selectedType = { selectedType }
480
484
setSelectedType = { setSelectedType }
481
485
resComp = { resComp }
482
- id = { id }
486
+ id = { id }
487
+ $level = { level }
483
488
/> }
484
489
{ ! readOnly && ! isOverlay && (
485
490
< EditPopover del = { ( ) => onDelete ( ) } >
0 commit comments