1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

link up transaction IDs with submarine, support pacific too

This commit is contained in:
Matthias Kretschmann 2019-06-13 16:43:47 +02:00
parent 01d5bf703d
commit 97d6c2756e
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 49 additions and 25 deletions

View File

@ -14,22 +14,28 @@ const VersionTableContracts = ({
<table> <table>
<tbody> <tbody>
{contracts && {contracts &&
Object.keys(contracts).map(key => ( Object.keys(contracts).map(key => {
<tr key={key}> const submarineLink = `https://submarine${
<td> network === 'duero'
<span className={styles.label}>{key}</span> ? '.duero'
</td> : network === 'pacific'
<td> ? '.pacific'
<a : ''
href={`https://submarine${ }.dev-ocean.com/address/${contracts[key]}`
network === 'duero' ? '.duero' : ''
}.dev-ocean.com/address/${contracts[key]}`} return (
> <tr key={key}>
<code>{contracts[key]}</code> <td>
</a> <span className={styles.label}>{key}</span>
</td> </td>
</tr> <td>
))} <a href={submarineLink}>
<code>{contracts[key]}</code>
</a>
</td>
</tr>
)
})}
</tbody> </tbody>
</table> </table>
) )

View File

@ -16,6 +16,8 @@ interface FaucetState {
} }
export default class Faucet extends PureComponent<{}, FaucetState> { export default class Faucet extends PureComponent<{}, FaucetState> {
public static contextType = User
public state = { public state = {
isLoading: false, isLoading: false,
success: undefined, success: undefined,
@ -59,15 +61,31 @@ export default class Faucet extends PureComponent<{}, FaucetState> {
}) })
} }
private Success = () => ( private Success = () => {
<div className={styles.success}> const { network } = this.context
<strong>{this.state.success}</strong> const { trxHash } = this.state
<p>
<strong>Your Transaction Hash</strong> const submarineLink = `https://submarine${
<code>{this.state.trxHash}</code> network === 'Duero'
</p> ? '.duero'
</div> : network === 'Pacific'
) ? '.pacific'
: ''
}.dev-ocean.com/tx/${trxHash}`
return (
<div className={styles.success}>
<strong>{this.state.success}</strong>
<p>
<strong>Your Transaction Hash</strong>
<a href={submarineLink}>
<code>{trxHash}</code>
</a>
</p>
</div>
)
}
private Error = () => ( private Error = () => (
<div className={styles.error}> <div className={styles.error}>