Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Show resolved name of org
Alexis Sellier committed 5 years ago
commit 4af7b38f1cb3b4bd1d17d599c530bda26c97daf8
parent c7172935f0ff341fbcd4bc1fd3ca8f13a522c909
4 files changed +41 -2
modified public/index.css
@@ -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);
modified src/Loading.svelte
@@ -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>
modified src/base/orgs/Org.ts
@@ -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 {
modified src/base/orgs/Profile.svelte
@@ -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}