Show resolved name of org

This commit is contained in:
Alexis Sellier
2021-05-04 15:27:29 +02:00
parent c7172935f0
commit 4af7b38f1c
4 changed files with 41 additions and 2 deletions
+5
View File
@@ -42,6 +42,7 @@
--color-foreground-6: #d3dee8;
--color-background: #0b131a;
--color-glow: #5555ff22;
--color-subtle: #777;
--font-family-sans-serif: Inter, sans-serif;
--font-family-monospace: monospace;
@@ -234,6 +235,10 @@ input.wide {
.highlight {
color: var(--color-secondary);
}
.subtle {
color: var(--color-subtle);
font-style: italic;
}
button.error:hover {
background-color: var(--color-negative);
+15 -2
View File
@@ -1,6 +1,10 @@
<script lang="typescript">
export let small = false;
</script>
<style>
.spinner {
margin: 100px auto 0;
margin: auto 0;
width: 70px;
text-align: center;
}
@@ -16,6 +20,15 @@
animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}
.spinner.small > div {
width: 0.5rem;
height: 0.5rem;
}
.spinner.small {
width: 35px;
}
.spinner .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
@@ -42,7 +55,7 @@
}
</style>
<div class="spinner">
<div class="spinner" class:small>
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
+7
View File
@@ -14,10 +14,17 @@ const orgAbi = ["function owner() view returns (address)"];
export class Org {
address: string
safe: string
name: string | null
constructor(address: string, safe: string) {
this.address = address;
this.safe = safe;
this.name = null;
}
async resolveAddress(config: Config): Promise<string> {
this.name = await config.provider.lookupAddress(this.address);
return this.name;
}
static fromReceipt(receipt: ContractReceipt): Org | null {
+14
View File
@@ -21,6 +21,20 @@
<table>
<tr><td class="label">Address</td><td>{org.address}</td></tr>
<tr><td class="label">Safe</td><td>{org.safe}</td></tr>
<tr>
<td class="label">Name</td>
<td>
{#await org.resolveAddress(config)}
<Loading small />
{:then name}
{#if name}
{name}
{:else}
<span class="subtle">Not registered</span>
{/if}
{/await}
</td>
</tr>
</table>
</div>
{:else}