[ui] basic resolving indicator
parent
6c09f6ccef
commit
18fbad3191
|
@ -10,14 +10,17 @@
|
|||
export let link = false;
|
||||
export let isFile = false;
|
||||
export let resolve = true;
|
||||
let resolving = resolve;
|
||||
|
||||
// Identification
|
||||
let inferredIds = [];
|
||||
const { attributes, backlinks } = useEntity(address, () => resolve);
|
||||
$: {
|
||||
if (resolve) {
|
||||
resolving = true;
|
||||
identify($attributes, $backlinks).then((inferredEntries) => {
|
||||
inferredIds = inferredEntries.map((eid) => eid.value);
|
||||
resolving = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -27,17 +30,19 @@
|
|||
<HashBadge {address} />
|
||||
<div class="separator" />
|
||||
<Marquee>
|
||||
{#if isFile}
|
||||
<UpLink to={{ entity: address }}>
|
||||
{address}
|
||||
</UpLink>
|
||||
{:else if link}
|
||||
<UpLink to={{ entity: address }}>
|
||||
<div class="inner" class:resolving>
|
||||
{#if isFile}
|
||||
<UpLink to={{ entity: address }}>
|
||||
{address}
|
||||
</UpLink>
|
||||
{:else if link}
|
||||
<UpLink to={{ entity: address }}>
|
||||
{inferredIds.join(" | ") || address}
|
||||
</UpLink>
|
||||
{:else}
|
||||
{inferredIds.join(" | ") || address}
|
||||
</UpLink>
|
||||
{:else}
|
||||
{inferredIds.join(" | ") || address}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</Marquee>
|
||||
</div>
|
||||
|
||||
|
@ -64,4 +69,8 @@
|
|||
.separator {
|
||||
width: 0.5em;
|
||||
}
|
||||
|
||||
.resolving {
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue