Skip to content

Commit a43a1bb

Browse files
[docs] Fix default theme viewer styling (#47400)
Signed-off-by: sai chand <[email protected]> Co-authored-by: Zeeshan Tamboli <[email protected]>
1 parent bb64ab1 commit a43a1bb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/src/modules/components/ThemeViewer.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff 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
})}

0 commit comments

Comments
 (0)