// Copyright 2015-2018 Parity Technologies (UK) Ltd. // This file is part of Parity. // // SPDX-License-Identifier: MIT import React, { Component } from 'react'; import { findDOMNode } from 'react-dom'; import { FormField, Header } from 'light-ui'; import { inject, observer } from 'mobx-react'; import { Link } from 'react-router-dom'; import ReactTooltip from 'react-tooltip'; import TokenBalance from '../../Tokens/TokensList/TokenBalance'; @inject('sendStore') @observer class Signer extends Component { state = { error: null, isSending: false, password: '' }; handleAccept = event => { const { history, sendStore } = this.props; const { password } = this.state; event.preventDefault(); this.setState({ isSending: true }, () => { sendStore .acceptRequest(password) .then(() => history.push('/send/sent')) .catch(error => { this.setState({ error, isSending: false }, () => ReactTooltip.show(findDOMNode(this.tooltip)) ); }); }); }; handleChangePassword = ({ target: { value } }) => { this.setState({ error: null, password: value }); }; handleReject = () => { const { history, sendStore } = this.props; this.setState({ isSending: true }, () => { sendStore .rejectRequest() .then(() => history.goBack()) .catch(() => history.goBack()); }); }; handleTooltipRef = ref => { this.tooltip = ref; }; render () { const { sendStore: { token, tx, txStatus } } = this.props; const { error, isSending, password } = this.state; return (
Close } title={

Send {token.name}

} />
{tx.amount} {token.symbol}
{tx.to}
,

Enter your password to confirm this transaction.

]} onClick={null} token={token} />
); } } export default Signer;