File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
docs/src/modules/components Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,13 @@ const TreeItem = styled(MuiTreeItem)(({ theme }) => ({
120120 } ,
121121} ) ) ;
122122
123- function ObjectEntry ( props : { itemId : string ; objectKey : string ; objectValue : any } ) {
124- const { itemId, objectKey, objectValue } = props ;
123+ function ObjectEntry ( props : {
124+ itemId : string ;
125+ objectKey : string ;
126+ objectValue : any ;
127+ depth : number ;
128+ } ) {
129+ const { itemId, objectKey, objectValue, depth } = props ;
125130 const keyPrefix = itemId ;
126131 let children = null ;
127132
@@ -138,6 +143,7 @@ function ObjectEntry(props: { itemId: string; objectKey: string; objectValue: an
138143 key = { key }
139144 itemId = { `${ keyPrefix } .${ key } ` }
140145 objectKey = { key }
146+ depth = { depth + 1 }
141147 objectValue = { objectValue [ key ] }
142148 />
143149 ) ;
@@ -146,6 +152,9 @@ function ObjectEntry(props: { itemId: string; objectKey: string; objectValue: an
146152
147153 return (
148154 < TreeItem
155+ sx = { {
156+ paddingLeft : depth ,
157+ } }
149158 itemId = { itemId }
150159 label = { < ObjectEntryLabel objectKey = { objectKey } objectValue = { objectValue } /> }
151160 >
@@ -222,6 +231,7 @@ export default function ThemeViewer({
222231 itemId = { `${ keyPrefix } .${ objectKey } ` }
223232 objectKey = { objectKey }
224233 objectValue = { data [ objectKey ] }
234+ depth = { 0 }
225235 />
226236 ) ;
227237 } ) }
You can’t perform that action at this time.
0 commit comments