Merge branch 'nodesImprovements' into minimizeNode

This commit is contained in:
igorrCarvalho 2023-09-12 14:28:54 -03:00
commit a0c7712b70
3 changed files with 47 additions and 36 deletions

View file

@ -118,45 +118,54 @@ export default function ParameterComponent({
nodeIconsLucide[item.family] ?? nodeIconsLucide["unknown"];
return (
<span
key={index}
className={classNames(
index > 0 ? "mt-2 flex items-center" : "flex items-center"
)}
>
<div
className="h-5 w-5"
style={{
color: nodeColors[item.family],
}}
>
<Icon
<>
{index === 0 && (
<span>
{left ? "Components to connect into:" : "Components to connect to:"}
</span>
)
}
<span
key={index}
className={classNames(
index > 0 ? "mt-2 flex items-center" : "mt-3 flex items-center"
)}
>
<div
className="h-5 w-5"
strokeWidth={1.5}
style={{
color: nodeColors[item.family] ?? nodeColors.unknown,
color: nodeColors[item.family],
}}
/>
</div>
<span className="ps-2 text-xs text-foreground">
{nodeNames[item.family] ?? "Other"}
<span className="text-xs">
>
<Icon
className="h-5 w-5"
strokeWidth={1.5}
style={{
color: nodeColors[item.family] ?? nodeColors.unknown,
}}
/>
</div>
<span className="ps-2 text-xs text-foreground">
{nodeNames[item.family] ?? "Other"}
{" "}
{item.type === "" ? "" : " - "}
{item.type.split(", ").length > 2
? item.type.split(", ").map((el, index) => (
<React.Fragment key={el + index}>
<span>
{index === item.type.split(", ").length - 1
? el
: (el += `, `)}
</span>
</React.Fragment>
))
: item.type}
<span className="text-xs">
{" "}
{item.type === "" ? "" : " - "}
{item.type.split(", ").length > 2
? item.type.split(", ").map((el, index) => (
<React.Fragment key={el + index}>
<span>
{index === item.type.split(", ").length - 1
? el
: (el += `, `)}
</span>
</React.Fragment>
))
: item.type}
</span>
</span>
</span>
</span>
</>
);
});
} else {

View file

@ -168,8 +168,10 @@ export default function GenericNode({
</div>
</div>
<div className="generic-node-desc">
<div className="generic-node-desc-text">{data.node?.description}</div>
<div className={"generic-node-desc " + (data.node?.description !== "" ? "py-5" : "pb-5")}>
{data.node?.description !== "" && (
<div className="generic-node-desc-text">{data.node?.description}</div>
)}
<>
{Object.keys(data.node!.template)

View file

@ -311,7 +311,7 @@
@apply hover:text-accent-foreground hover:transition-all;
}
.generic-node-desc {
@apply h-full w-full py-5 text-foreground;
@apply h-full w-full text-foreground;
}
.generic-node-desc-text {
@apply w-full px-5 pb-3 text-sm text-muted-foreground;