mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
output transaction hash
This commit is contained in:
parent
bdf7670b3d
commit
4a6053ec82
@ -12,6 +12,19 @@
|
|||||||
|
|
||||||
.success {
|
.success {
|
||||||
color: $green;
|
color: $green;
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: $spacer / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
strong {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.error {
|
.error {
|
||||||
|
@ -10,13 +10,15 @@ interface FaucetState {
|
|||||||
isLoading: boolean
|
isLoading: boolean
|
||||||
success?: string
|
success?: string
|
||||||
error?: string
|
error?: string
|
||||||
|
trxHash?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Faucet extends PureComponent<{}, FaucetState> {
|
export default class Faucet extends PureComponent<{}, FaucetState> {
|
||||||
public state = {
|
public state = {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
success: undefined,
|
success: undefined,
|
||||||
error: undefined
|
error: undefined,
|
||||||
|
trxHash: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
private getTokens = async (requestFromFaucet: () => any) => {
|
private getTokens = async (requestFromFaucet: () => any) => {
|
||||||
@ -33,9 +35,12 @@ export default class Faucet extends PureComponent<{}, FaucetState> {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { trxHash } = response
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
success: response.message
|
success: response.message,
|
||||||
|
trxHash
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.setState({ isLoading: false, error })
|
this.setState({ isLoading: false, error })
|
||||||
@ -51,7 +56,13 @@ export default class Faucet extends PureComponent<{}, FaucetState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Success = () => (
|
private Success = () => (
|
||||||
<div className={styles.success}>{this.state.success}</div>
|
<div className={styles.success}>
|
||||||
|
<strong>{this.state.success}</strong>
|
||||||
|
<p>
|
||||||
|
<strong>Your Transaction Hash</strong>
|
||||||
|
<code>{this.state.trxHash}</code>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
private Error = () => (
|
private Error = () => (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user