mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Add org profile view
This commit is contained in:
@@ -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>
|
||||
@@ -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,
|
||||
|
||||
@@ -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}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user