From ec6e0451f0185758df0e81a8f475d3feca0dbd56 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Fri, 16 Dec 2022 14:00:26 +0100 Subject: [PATCH] feat(frontend): Align output panel UI (#1025) * feat(frontend): Align output pane UI * feat(frontend): Align UI --- .../components/apps/editor/GridEditor.svelte | 2 +- .../contextPanel/ComponentOutputViewer.svelte | 8 +++- .../editor/contextPanel/ContextPanel.svelte | 37 ++++++++++++++----- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/GridEditor.svelte b/frontend/src/lib/components/apps/editor/GridEditor.svelte index f4cfaccc2a..643be8e550 100644 --- a/frontend/src/lib/components/apps/editor/GridEditor.svelte +++ b/frontend/src/lib/components/apps/editor/GridEditor.svelte @@ -74,7 +74,7 @@ {#if $connectingInput.opened}
diff --git a/frontend/src/lib/components/apps/editor/contextPanel/ComponentOutputViewer.svelte b/frontend/src/lib/components/apps/editor/contextPanel/ComponentOutputViewer.svelte index 0dedab20cb..a84a243831 100644 --- a/frontend/src/lib/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +++ b/frontend/src/lib/components/apps/editor/contextPanel/ComponentOutputViewer.svelte @@ -13,7 +13,7 @@ function subscribeToAllOutputs(observableOutputs: Record>) { if (observableOutputs) { - outputs.forEach((output) => { + outputs.forEach((output: string) => { observableOutputs[output].subscribe({ next: (value) => { object[output] = value @@ -27,4 +27,8 @@ subscribeToAllOutputs($worldStore.outputsById[componentId]) - +{#if Object.keys(object).length > 0} + +{:else} +
No outputs
+{/if} diff --git a/frontend/src/lib/components/apps/editor/contextPanel/ContextPanel.svelte b/frontend/src/lib/components/apps/editor/contextPanel/ContextPanel.svelte index 9a1c9ff047..51d3a2ecd4 100644 --- a/frontend/src/lib/components/apps/editor/contextPanel/ContextPanel.svelte +++ b/frontend/src/lib/components/apps/editor/contextPanel/ContextPanel.svelte @@ -1,12 +1,12 @@ {#each Object.entries($staticOutputs) as [componentId, outputs], index} {#if outputs.length > 0 && $worldStore?.outputsById[componentId]} - - -
($selectedComponent = componentId)} class={classNames( - 'w-full p-2 rounded-xs border', + 'px-1 text-2xs py-0.5 font-bold rounded-t-sm w-fit -mb-2', $selectedComponent === componentId - ? 'outline-1 outline outline-offset-2 outline-blue-500' - : '' + ? ' bg-indigo-500 text-white' + : 'bg-gray-200 text-gray-500' + )} + > + {getComponentNameById(componentId)} - + {componentId} + + + +
($selectedComponent = componentId)} + class={classNames( + 'w-full py-2 border', + $selectedComponent === componentId ? 'border border-blue-500' : 'cursor-pointer' )} >