Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add org profile view
Alexis Sellier committed 5 years ago
commit bd70b4148226f0e77cc928fab728ffd5ac96584e
parent fb1d496ed098e6e1a8f3faf69a02692972d72ea9
4 files changed +89 -0
added src/Loading.svelte
@@ -0,0 +1,49 @@
+
<style>
+
  .spinner {
+
    margin: 100px auto 0;
+
    width: 70px;
+
    text-align: center;
+
  }
+

+
  .spinner > div {
+
    width: 18px;
+
    height: 18px;
+
    background-color: #5555ff;
+

+
    border-radius: 100%;
+
    display: inline-block;
+
    -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
+
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
+
  }
+

+
  .spinner .bounce1 {
+
    -webkit-animation-delay: -0.32s;
+
    animation-delay: -0.32s;
+
  }
+

+
  .spinner .bounce2 {
+
    -webkit-animation-delay: -0.16s;
+
    animation-delay: -0.16s;
+
  }
+

+
  @-webkit-keyframes sk-bouncedelay {
+
    0%, 80%, 100% { -webkit-transform: scale(0) }
+
    40% { -webkit-transform: scale(1.0) }
+
  }
+

+
  @keyframes sk-bouncedelay {
+
    0%, 80%, 100% {
+
      -webkit-transform: scale(0);
+
      transform: scale(0);
+
    } 40% {
+
      -webkit-transform: scale(1.0);
+
      transform: scale(1.0);
+
    }
+
  }
+
</style>
+

+
<div class="spinner">
+
  <div class="bounce1"></div>
+
  <div class="bounce2"></div>
+
  <div class="bounce3"></div>
+
</div>
modified src/base/orgs/Org.ts
@@ -32,6 +32,20 @@ export class Org {
    return null;
  }

+
  static async get(
+
    address: string,
+
    config: Config,
+
  ): Promise<Org> {
+
    const org = new ethers.Contract(
+
      address,
+
      orgAbi,
+
      config.provider
+
    );
+
    let safe = await org.owner();
+

+
    return new Org(address, safe);
+
  }
+

  static async create(
    owner: string,
    config: Config,
added src/base/orgs/Profile.svelte
@@ -0,0 +1,21 @@
+
<script lang="typescript">
+
  import type { Config } from '@app/config';
+
  import { Org } from './Org';
+
  import Loading from '@app/Loading.svelte';
+

+
  export let address: string;
+
  export let config: Config;
+
</script>
+

+
{#await Org.get(address, config)}
+
  <Loading/>
+
{:then org}
+
  <div>
+
    <table>
+
      <tr><td class="label">Address</td><td>{org.address}</td></tr>
+
      <tr><td class="label">Safe</td><td>{org.safe}</td></tr>
+
    </table>
+
  </div>
+
{:catch err}
+
  {err}
+
{/await}
modified src/base/orgs/Routes.svelte
@@ -1,6 +1,7 @@
<script lang="typescript">
  import { Route } from "svelte-routing";
  import Orgs from '@app/base/orgs/Orgs.svelte';
+
  import Profile from '@app/base/orgs/Profile.svelte';
  import type { Config } from '@app/config';

  export let config: Config;
@@ -9,3 +10,7 @@
<Route path="/orgs">
  <Orgs {config} />
</Route>
+

+
<Route path="/orgs/:address" let:params>
+
  <Profile {config} address={params.address} />
+
</Route>