From 97d6c2756ed31f90f960dae21b8889d61232cd09 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 13 Jun 2019 16:43:47 +0200 Subject: [PATCH] link up transaction IDs with submarine, support pacific too --- .../molecules/VersionNumbers/VersionTable.tsx | 38 +++++++++++-------- client/src/routes/Faucet.tsx | 36 +++++++++++++----- 2 files changed, 49 insertions(+), 25 deletions(-) diff --git a/client/src/components/molecules/VersionNumbers/VersionTable.tsx b/client/src/components/molecules/VersionNumbers/VersionTable.tsx index e84a361..20b8f58 100644 --- a/client/src/components/molecules/VersionNumbers/VersionTable.tsx +++ b/client/src/components/molecules/VersionNumbers/VersionTable.tsx @@ -14,22 +14,28 @@ const VersionTableContracts = ({ {contracts && - Object.keys(contracts).map(key => ( - - - - - ))} + Object.keys(contracts).map(key => { + const submarineLink = `https://submarine${ + network === 'duero' + ? '.duero' + : network === 'pacific' + ? '.pacific' + : '' + }.dev-ocean.com/address/${contracts[key]}` + + return ( + + + + + ) + })}
- {key} - - - {contracts[key]} - -
+ {key} + + + {contracts[key]} + +
) diff --git a/client/src/routes/Faucet.tsx b/client/src/routes/Faucet.tsx index fd97dba..bed7633 100644 --- a/client/src/routes/Faucet.tsx +++ b/client/src/routes/Faucet.tsx @@ -16,6 +16,8 @@ interface FaucetState { } export default class Faucet extends PureComponent<{}, FaucetState> { + public static contextType = User + public state = { isLoading: false, success: undefined, @@ -59,15 +61,31 @@ export default class Faucet extends PureComponent<{}, FaucetState> { }) } - private Success = () => ( -
- {this.state.success} -

- Your Transaction Hash - {this.state.trxHash} -

-
- ) + private Success = () => { + const { network } = this.context + const { trxHash } = this.state + + const submarineLink = `https://submarine${ + network === 'Duero' + ? '.duero' + : network === 'Pacific' + ? '.pacific' + : '' + }.dev-ocean.com/tx/${trxHash}` + + return ( +
+ {this.state.success} +

+ Your Transaction Hash + + + {trxHash} + +

+
+ ) + } private Error = () => (