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