Skip to content

Commit

Permalink
fix contrasting from set output
Browse files Browse the repository at this point in the history
  • Loading branch information
mck committed Nov 24, 2023
1 parent 483a38f commit 23cc354
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-elephants-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/graph-editor": patch
---

Fix output of Contrasting from Set
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,6 @@ const ContrastingFromSetNode = () => {
[setState],
);

const entries = useMemo(() => {
if (!output || typeof output !== 'object' || !output.token) {
return null;
}

return Object.entries(output.token).map(([key, value]) => (
<Handle id={key} key={key}>
<HandleText>{key}</HandleText>
<PreviewAny value={value} />
</Handle>
));
}, [output]);

return (
<Stack direction="row" gap={4}>
<HandleContainer type="target">
Expand Down Expand Up @@ -117,7 +104,10 @@ const ContrastingFromSetNode = () => {
</Handle>
</HandleContainer>
<HandleContainer type="source">
{entries}
<Handle id="token">
<HandleText>Token</HandleText>
<PreviewAny value={output?.token} />
</Handle>
<Handle id="index">
<HandleText>Index</HandleText>
<Text>{output.index}</Text>
Expand Down

0 comments on commit 23cc354

Please sign in to comment.