From 5e045cd85e7c5c657c5c00a7e6e0f5e48708996d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Mon, 20 Dec 2021 13:41:06 +0100 Subject: [PATCH] don't render before allTypeEntries loaded, unify spinner look --- ui/src/App.svelte | 11 +++++- ui/src/components/Inspect.svelte | 64 +++++++++++++++++--------------- ui/src/views/Home.svelte | 10 +---- 3 files changed, 47 insertions(+), 38 deletions(-) diff --git a/ui/src/App.svelte b/ui/src/App.svelte index 5c0b1ea..d2721a0 100644 --- a/ui/src/App.svelte +++ b/ui/src/App.svelte @@ -42,7 +42,7 @@ @import url("/assets/fonts/inter.css"); $primary: #2c3e50; - $primary-lighter: #394F66; + $primary-lighter: #394f66; $background: white; html { @@ -129,4 +129,13 @@ a:visited { color: var(--foreground); } + + sl-spinner { + font-size: 2em; + --track-width: 6px; + + position: relative; + left: 50%; + transform: translateX(-50%); + } diff --git a/ui/src/components/Inspect.svelte b/ui/src/components/Inspect.svelte index 5eea08b..387ef7f 100644 --- a/ui/src/components/Inspect.svelte +++ b/ui/src/components/Inspect.svelte @@ -83,41 +83,47 @@

{#if $entity}
+ {:else} + {/if}

{#if !$error} -
- {#each Object.entries(typedAttributes) as [typeAddr, entries] (typeAddr)} - - {/each} + {#if Boolean($allTypeEntries)} +
+ {#each Object.entries(typedAttributes) as [typeAddr, entries] (typeAddr)} + + {/each} - {#if untypedAttributes.length > 0 || editable} - - {/if} + {#if untypedAttributes.length > 0 || editable} + + {/if} - {#if $entity?.backlinks.length > 0} - - {/if} -
+ {#if $entity?.backlinks.length > 0} + + {/if} +
+ {:else} + + {/if} {:else}
{JSON.stringify($error)} diff --git a/ui/src/views/Home.svelte b/ui/src/views/Home.svelte index 397effb..27381a3 100644 --- a/ui/src/views/Home.svelte +++ b/ui/src/views/Home.svelte @@ -39,7 +39,7 @@

Roots

{#await roots} - + {:then data}
    {#each data as root} @@ -63,7 +63,7 @@

    Most recently added files

    {#await latestFiles} - + {:then data} {#each data as file} @@ -98,12 +98,6 @@ } } - sl-spinner { - position: relative; - left: 50%; - transform: translateX(-50%); - } - .roots { ul { list-style: none;