Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Display short addresses differently
Alexis Sellier committed 4 years ago
commit 3a5ee3f3d6c8ab2d0086f17c07464b1f6aeecf4b
parent 6fcac9cffe96e59a64baf31912eccadea1eb81fc
3 files changed +10 -6
modified src/Header.svelte
@@ -70,7 +70,7 @@
    justify-content: center;
    min-height: 42px;
    margin-left: 2rem;
-
    width: 9.25rem;
+
    width: 10rem;
  }
  .connect {
    display: inline-block;
modified src/base/orgs/List.svelte
@@ -15,8 +15,8 @@

<style>
  .org {
-
    width: 7rem;
-
    height: 7rem;
+
    width: 8rem;
+
    height: 8rem;
    margin-left: 3rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
@@ -41,7 +41,7 @@
    padding: 0rem 0.5rem;
    text-overflow: ellipsis;
    overflow-x: hidden;
-
    max-width: 7rem;
+
    max-width: 8rem;
  }
  .list {
    display: flex;
modified src/utils.ts
@@ -48,8 +48,12 @@ export function formatCAIP10Address(address: string, protocol: string, impl: num
  return `${address.toLowerCase()}@${protocol}:${impl.toString()}`;
}

-
export function formatAddress(addr: string): string {
-
  return formatHash(ethers.utils.getAddress(addr)).replace(/^0x/, "");
+
export function formatAddress(input: string): string {
+
  const addr = ethers.utils.getAddress(input).replace(/^0x/, "");
+

+
  return addr.substring(0, 4)
+
    + ' – '
+
    + addr.substring(addr.length - 4, addr.length);
}

export function formatIpfsFile(ipfs: string | undefined): string | undefined {