diff --git a/public/index.css b/public/index.css
index fe3163fd8..ba8da3097 100644
--- a/public/index.css
+++ b/public/index.css
@@ -28,6 +28,7 @@
--color-yellow: #ffff99;
--color-yellow-background: #ffff9911;
--color-positive: #53db53;
+ --color-positive-background: #53db5311;
--color-positive-1: #21402f;
--color-positive-2: #2c6837;
--color-positive-6: #e3ffe3;
diff --git a/src/Address.svelte b/src/Address.svelte
index 5a8cbf15f..b9f8e31f2 100644
--- a/src/Address.svelte
+++ b/src/Address.svelte
@@ -6,13 +6,17 @@
import Blockies from '@app/Blockies.svelte';
import Loading from '@app/Loading.svelte';
import type { Config } from '@app/config';
- import { identifyAddress, AddressType } from '@app/utils';
+ import { identifyAddress, formatAddress, AddressType } from '@app/utils';
export let address: string;
export let config: Config;
export let resolve = false;
+ export let noBadge = false;
+ export let compact = false;
- let checksumAddress = ethers.utils.getAddress(address);
+ let checksumAddress = compact
+ ? formatAddress(address)
+ : ethers.utils.getAddress(address);
let addressType: AddressType | null = null;
let addressName: string | null = null;
@@ -31,6 +35,9 @@
display: flex;
align-items: center;
}
+ .address.no-badge .badge {
+ display: none;
+ }
.icon {
display: inline-block;
width: 1rem;
@@ -51,7 +58,7 @@
}
-
+
{#if addressType === AddressType.Org}
{addressLabel}
@@ -65,7 +72,7 @@
contract
{:else if addressType === AddressType.EOA}
- {:else}
+ {:else if !noBadge}
{/if}
{/if}
diff --git a/src/Loading.svelte b/src/Loading.svelte
index c21ee51c7..88a0e0ce2 100644
--- a/src/Loading.svelte
+++ b/src/Loading.svelte
@@ -3,6 +3,7 @@
export let color = "secondary";
export let center = false;
export let fadeIn = false;
+ export let margins = false;
-
+
diff --git a/src/base/orgs/Org.ts b/src/base/orgs/Org.ts
index 383ca815a..bc294fa97 100644
--- a/src/base/orgs/Org.ts
+++ b/src/base/orgs/Org.ts
@@ -96,6 +96,26 @@ export class Org {
return projects;
}
+ static async getAnchor(orgAddr: string, urn: string, config: Config): Promise
{
+ const org = new ethers.Contract(
+ orgAddr,
+ config.abi.org,
+ config.provider
+ );
+ const unpadded = utils.parseRadicleId(urn);
+ const id = ethers.utils.zeroPad(unpadded, 32);
+
+ try {
+ const result = await org.anchors(id);
+ const anchor = utils.formatProjectHash(ethers.utils.arrayify(result[0]));
+
+ return anchor;
+ } catch (e) {
+ console.error(e);
+ return null;
+ }
+ }
+
static async getAll(config: Config): Promise> {
const result = await utils.querySubgraph(GetOrgs, {}, config);
const orgs: Org[] = [];
diff --git a/src/base/projects/Browser.svelte b/src/base/projects/Browser.svelte
index 622a177f7..f63b46d7d 100644
--- a/src/base/projects/Browser.svelte
+++ b/src/base/projects/Browser.svelte
@@ -2,6 +2,8 @@
import type { Config } from '@app/config';
import * as proj from '@app/project';
import Loading from '@app/Loading.svelte';
+ import Address from '@app/Address.svelte';
+ import { Org } from '@app/base/orgs/Org';
import Tree from './Tree.svelte';
import Blob from './Blob.svelte';
@@ -11,6 +13,7 @@
export let config: Config;
export let path: string;
export let onSelect: (event: { detail: string }) => void;
+ export let org: string | null = null;
let blob: Promise | null = null;
@@ -23,14 +26,16 @@
} else {
blob = proj.getBlob(urn, commit, path, config);
}
+ $: getAnchor = org ? Org.getAnchor(org, urn, config) : null;