mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Show resolved name of org
This commit is contained in:
@@ -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
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user