Fix testate check and balance warning
This commit is contained in:
parent
93c627be9d
commit
7858f41e30
@ -588,7 +588,7 @@ class App extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={this.state.connected && !this.state.locked ? "App" : "App dim"}>
|
||||
<div className={this.state.connected && !this.state.locked && this.state.interaction !== 'disconnected' ? "App" : "App dim"}>
|
||||
<Head />
|
||||
<section className="title">
|
||||
<div className="logo border pa2">
|
||||
@ -598,6 +598,7 @@ class App extends Component {
|
||||
network={this.state.networkMessage}
|
||||
connected={this.state.connected}
|
||||
metamask={this.props.metamask}
|
||||
interaction={this.state.interaction}
|
||||
address={this.state.currentMaskAddress}
|
||||
locked={this.state.locked}
|
||||
balance={this.state.inputBalance}/>
|
||||
@ -691,7 +692,7 @@ class App extends Component {
|
||||
</a>
|
||||
</section>
|
||||
|
||||
{this.state.transactions.length > 0 ?
|
||||
{this.state.transactions.length > 0 && this.state.interaction !== 'disconnected' ?
|
||||
<section className="transaction border pa2">
|
||||
<p className="underline">Past Transactions:</p>
|
||||
<Transactions transactions={this.state.transactions}/>
|
||||
|
@ -53,17 +53,22 @@ function ConnectionHelper(props) {
|
||||
<p>You can't swap a token for itself! 😂</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
else if (props.interaction === "submitted") {
|
||||
} else if (props.interaction === "submitted") {
|
||||
return (
|
||||
<div className="grey-bg connection border pa2">
|
||||
<p>{"Transaction submitted! Click on the transaction hash below to check its status?"}</p>
|
||||
</div>
|
||||
)
|
||||
} else if (props.input > props.balance/10**18) {
|
||||
} else if (props.input > props.balance/10**18 && props.inputToken.value === 'ETH') {
|
||||
return (
|
||||
<div className="grey-bg red connection border pa2">
|
||||
<p>This account doesn't have enough balance to make this transaction! Get more ETH with the <a target="_blank" href="https://faucet.rinkeby.io/">Rinkeby Faucet.</a></p>
|
||||
<p>This account doesn't have enough balance to make this transaction! Get more {props.inputToken.value} with the <a target="_blank" href="https://faucet.rinkeby.io/">Rinkeby Faucet.</a></p>
|
||||
</div>
|
||||
)
|
||||
} else if (props.input > props.balance/10**18) {
|
||||
return (
|
||||
<div className="grey-bg red connection border pa2">
|
||||
<p>{"This account doesn't have enough balance to make this transaction! You'll need to swap some ETH for " + props.inputToken.value + "."}</p>
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
|
@ -5,7 +5,7 @@ function NetworkStatus(props) {
|
||||
let metamask = props.metamask
|
||||
let locked = props.locked
|
||||
|
||||
if (isConnected){
|
||||
if (isConnected && props.interaction !== 'disconnected'){
|
||||
return (
|
||||
<div className="connection border pa2 green">
|
||||
<a target="_blank" href={'https://rinkeby.etherscan.io/search?q=' + props.address}>{props.address}</a>
|
||||
|
Loading…
Reference in New Issue
Block a user