diff --git a/packages/fether-react/src/Send/Signer/Signer.js b/packages/fether-react/src/Send/Signer/Signer.js index 0b9688915a426b6931dd64223a1c19944721cdae..bb21f86086d8fa2414726c7ffd2ed2dc9699f1db 100644 --- a/packages/fether-react/src/Send/Signer/Signer.js +++ b/packages/fether-react/src/Send/Signer/Signer.js @@ -18,30 +18,15 @@ import TokenBalance from '../../Tokens/TokensList/TokenBalance'; })) @observer class Signer extends Component { - state = { - error: null, - isSending: false, - password: '' - }; - - handleAccept = event => { + handleAccept = values => { const { history, sendStore, token } = this.props; - const { password } = this.state; - - event.preventDefault(); - this.setState({ isSending: true }, () => { - sendStore - .send(password) - .then(() => history.push(`/send/${token.address}/sent`)) - .catch(error => { - this.setState({ error, isSending: false }); - }); - }); - }; - - handleChangePassword = ({ target: { value } }) => { - this.setState({ error: null, password: value }); + return sendStore + .send(values.password) + .then(() => history.push(`/send/${token.address}/sent`)) + .catch(error => ({ + password: error + })); }; render () { @@ -52,7 +37,7 @@ class Signer extends Component { } = this.props; if (!tx || !token) { - return ; + return ; } return ( @@ -71,16 +56,20 @@ class Signer extends Component { -
- -
- {tx.amount} {token.symbol} -
-
-
- -
{tx.to}
-
+ + + ,
}