Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/src/modules/components/ThemeViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,13 @@ const TreeItem = styled(MuiTreeItem)(({ theme }) => ({
},
}));

function ObjectEntry(props: { itemId: string; objectKey: string; objectValue: any }) {
const { itemId, objectKey, objectValue } = props;
function ObjectEntry(props: {
itemId: string;
objectKey: string;
objectValue: any;
depth: number;
}) {
const { itemId, objectKey, objectValue, depth } = props;
const keyPrefix = itemId;
let children = null;

Expand All @@ -138,6 +143,7 @@ function ObjectEntry(props: { itemId: string; objectKey: string; objectValue: an
key={key}
itemId={`${keyPrefix}.${key}`}
objectKey={key}
depth={depth + 1}
objectValue={objectValue[key]}
/>
);
Expand All @@ -146,6 +152,9 @@ function ObjectEntry(props: { itemId: string; objectKey: string; objectValue: an

return (
<TreeItem
sx={{
paddingLeft: depth,
}}
itemId={itemId}
label={<ObjectEntryLabel objectKey={objectKey} objectValue={objectValue} />}
>
Expand Down Expand Up @@ -222,6 +231,7 @@ export default function ThemeViewer({
itemId={`${keyPrefix}.${objectKey}`}
objectKey={objectKey}
objectValue={data[objectKey]}
depth={0}
/>
);
})}
Expand Down
Loading