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 { ...@@ -588,7 +588,7 @@ class App extends Component {
render() { render() {
return ( 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 /> <Head />
<section className="title"> <section className="title">
<div className="logo border pa2"> <div className="logo border pa2">
...@@ -598,6 +598,7 @@ class App extends Component { ...@@ -598,6 +598,7 @@ class App extends Component {
network={this.state.networkMessage} network={this.state.networkMessage}
connected={this.state.connected} connected={this.state.connected}
metamask={this.props.metamask} metamask={this.props.metamask}
interaction={this.state.interaction}
address={this.state.currentMaskAddress} address={this.state.currentMaskAddress}
locked={this.state.locked} locked={this.state.locked}
balance={this.state.inputBalance}/> balance={this.state.inputBalance}/>
...@@ -691,7 +692,7 @@ class App extends Component { ...@@ -691,7 +692,7 @@ class App extends Component {
</a> </a>
</section> </section>
{this.state.transactions.length > 0 ? {this.state.transactions.length > 0 && this.state.interaction !== 'disconnected' ?
<section className="transaction border pa2"> <section className="transaction border pa2">
<p className="underline">Past Transactions:</p> <p className="underline">Past Transactions:</p>
<Transactions transactions={this.state.transactions}/> <Transactions transactions={this.state.transactions}/>
......
...@@ -53,17 +53,22 @@ function ConnectionHelper(props) { ...@@ -53,17 +53,22 @@ function ConnectionHelper(props) {
<p>You can't swap a token for itself! 😂</p> <p>You can't swap a token for itself! 😂</p>
</div> </div>
) )
} } else if (props.interaction === "submitted") {
else if (props.interaction === "submitted") {
return ( return (
<div className="grey-bg connection border pa2"> <div className="grey-bg connection border pa2">
<p>{"Transaction submitted! Click on the transaction hash below to check its status?"}</p> <p>{"Transaction submitted! Click on the transaction hash below to check its status?"}</p>
</div> </div>
) )
} 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) { } else if (props.input > props.balance/10**18) {
return ( return (
<div className="grey-bg red connection border pa2"> <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> </div>
) )
} else { } else {
......
...@@ -5,7 +5,7 @@ function NetworkStatus(props) { ...@@ -5,7 +5,7 @@ function NetworkStatus(props) {
let metamask = props.metamask let metamask = props.metamask
let locked = props.locked let locked = props.locked
if (isConnected){ if (isConnected && props.interaction !== 'disconnected'){
return ( return (
<div className="connection border pa2 green"> <div className="connection border pa2 green">
<a target="_blank" href={'https://rinkeby.etherscan.io/search?q=' + props.address}>{props.address}</a> <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