@@ -9,16 +9,17 @@ import { BASIC_SHAPE } from '../../front-components/shape.const';
99import {
1010 calculateFileTreeDynamicSize ,
1111 FileTreeItem ,
12+ getFileTreeSizeValues ,
1213 parseFileTreeText ,
1314} from './file-tree.business' ;
1415
1516const fileTreeShapeRestrictions : ShapeSizeRestrictions = {
16- minWidth : 220 ,
17- minHeight : 180 ,
17+ minWidth : 200 ,
18+ minHeight : 120 ,
1819 maxWidth : - 1 ,
1920 maxHeight : - 1 ,
20- defaultWidth : 280 ,
21- defaultHeight : 280 ,
21+ defaultWidth : 230 ,
22+ defaultHeight : 180 ,
2223} ;
2324
2425interface FileTreeShapeProps extends ShapeProps {
@@ -54,16 +55,17 @@ export const FileTreeShape = forwardRef<any, FileTreeShapeProps>(
5455 }
5556 ) ;
5657
57- const iconWidth = 50 ;
58- const elementHeight = 60 ;
59- const paddingX = 40 ;
60- const paddingY = 30 ;
58+ const { fontSize, iconWidth, elementHeight, size } = getFileTreeSizeValues (
59+ otherProps ?. size
60+ ) ;
61+
62+ const paddingX = 30 ;
63+ const paddingY = 25 ;
6164 const iconTextSpacing = 10 ;
62- const indentationStep = 10 ;
65+ const indentationStep = 25 ;
6366
6467 const restrictedSize = calculateFileTreeDynamicSize ( treeItems , {
6568 width,
66- height,
6769 elementHeight,
6870 paddingY,
6971 baseRestrictions : fileTreeShapeRestrictions ,
@@ -83,11 +85,7 @@ export const FileTreeShape = forwardRef<any, FileTreeShapeProps>(
8385
8486 // Helper functions for position calculations
8587 const calculateIconX = ( item : FileTreeItem ) => {
86- return (
87- paddingX +
88- item . level * indentationStep +
89- ( item . type === 'file' ? 40 : 0 )
90- ) ;
88+ return paddingX + item . level * indentationStep ;
9189 } ;
9290
9391 const calculateTextX = ( item : FileTreeItem ) => {
@@ -133,7 +131,7 @@ export const FileTreeShape = forwardRef<any, FileTreeShapeProps>(
133131 < Image
134132 image = { icons [ item . type ] ! }
135133 x = { calculateIconX ( item ) }
136- y = { paddingY + elementHeight * index }
134+ y = { paddingY + elementHeight * index + ( size === 'XS' ? 5 : 0 ) }
137135 width = { iconWidth }
138136 height = { iconWidth }
139137 />
@@ -145,7 +143,7 @@ export const FileTreeShape = forwardRef<any, FileTreeShapeProps>(
145143 width = { calculateAvailableWidth ( item ) }
146144 height = { elementHeight }
147145 fontFamily = { BASIC_SHAPE . DEFAULT_FONT_FAMILY }
148- fontSize = { 15 }
146+ fontSize = { fontSize }
149147 fill = { textColor }
150148 wrap = "none"
151149 ellipsis = { true }
0 commit comments