Skip to content

Commit eb33edb

Browse files
committed
Simplify
1 parent 8afba80 commit eb33edb

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

packages/sdk-components-react/src/xml-node.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,21 @@ export const XmlNode = forwardRef<ElementRef<"div">, Props>(
5454
);
5555

5656
return (
57-
<div style={{ display: isTextChild ? "block" : "block" }} {...props}>
57+
<div {...props}>
5858
<span style={{ color: "rgb(16, 23, 233)" }}>
5959
&lt;{[elementName, ...attributes].join(" ")}&gt;
6060
</span>
61-
{childrenArray.length > 0 &&
62-
(isTextChild ? (
63-
<span ref={ref}>{children}</span>
64-
) : (
65-
<div ref={ref} style={{ marginLeft: isTextChild ? 0 : "1rem" }}>
66-
{children}
67-
</div>
68-
))}
61+
{childrenArray.length > 0 && (
62+
<div
63+
ref={ref}
64+
style={{
65+
display: isTextChild ? "inline" : "block",
66+
marginLeft: isTextChild ? 0 : "1rem",
67+
}}
68+
>
69+
{children}
70+
</div>
71+
)}
6972
<span style={{ color: "rgb(16, 23, 233)" }}>
7073
&lt;/{elementName}&gt;
7174
</span>

0 commit comments

Comments
 (0)