Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add an explorer link to the not found page
Alexis Sellier committed 5 years ago
commit 73b00be0af0441c10320eefa915d1e545f4c28fd
parent 8cd5911449953d6d592cb210699a4391387b29a8
3 files changed +16 -1
modified public/index.css
@@ -224,6 +224,9 @@ input.wide {
	color: var(--color-subtle);
	font-style: italic;
}
+
.faded {
+
	color: var(--color-subtle);
+
}
.label {
	color: var(--color-secondary);
}
modified src/base/orgs/Profile.svelte
@@ -6,7 +6,7 @@
  import type { Config } from '@app/config';
  import type { Registration } from '@app/base/register/registrar';
  import { getRegistration } from '@app/base/register/registrar';
-
  import { parseEnsLabel } from '@app/utils';
+
  import { parseEnsLabel, explorerLink } from '@app/utils';
  import { Org } from './Org';
  import { session } from '@app/session';
  import Loading from '@app/Loading.svelte';
@@ -144,6 +144,10 @@
      <span slot="body">
        <p class="highlight"><strong>{address}</strong></p>
        <p>Sorry, there is no Org at this address.</p>
+
        <p>
+
          <a href={explorerLink(address, config)} target="_blank">View in explorer</a>
+
          <span class="faded">↗</span>
+
        </p>
      </span>
      <span slot="actions">
        <button on:click={back}>
modified src/utils.ts
@@ -51,3 +51,11 @@ export function getSearchParam(key: string, location: RouteLocation): string | n
  let params = new URLSearchParams(location.search);
  return params.get(key);
}
+

+
// Get the explorer link of an address, eg. Etherscan.
+
export function explorerLink(addr: string, config: Config): string {
+
  if (config.network.name == "ropsten") {
+
    return `https://ropsten.etherscan.io/address/${addr}`;
+
  }
+
  return `https://etherscan.io/address/${addr}`;
+
}