Commit 7858f41e authored by Callil Capuozzo's avatar Callil Capuozzo

Fix testate check and balance warning

parent 93c627be
......@@ -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 {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! 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! 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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment