Skip to content

Commit

Permalink
Separando sidebar em tipos
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallo-10 committed Oct 21, 2024
1 parent 7c895f8 commit 0d6025e
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions src/components/sidebar/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,31 @@
event.dataTransfer.effectAllowed = "move";
}
};
const types = Array.from(new Set(nodes.map((node: any) => node.extras.type)));
console.log(types);
</script>

<aside>
<div class="mb-0"></div>
<div class="flexbox items-center justify-center">
{#each nodes as node}
<div
class="output-node node"
role="button"
tabindex="0"
draggable={true}
on:dragstart={(event) => onDragStart(event, node)}
title={node.extras.description}
style={`border-color: ${node.color}`}
>
{node.name}
</div>
{#each types as type}
<div>{type}</div>
{#each nodes as node}
{#if node.extras.type == type}
<div
class="output-node node"
role="button"
tabindex="0"
draggable={true}
on:dragstart={(event) => onDragStart(event, node)}
title={node.extras.description}
style={`border-color: ${node.color}`}
>
{node.name}
</div>
{/if}
{/each}
{/each}
</div>
</aside>
Expand Down

0 comments on commit 0d6025e

Please sign in to comment.