Newer
Older
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: MIT
import React, { Component } from 'react';
import { inject, observer } from 'mobx-react';
import TokenBalance from '../../Tokens/TokensList/TokenBalance';
handleAccept = e => {
const { history, sendStore } = this.props;
const { password } = this.state;
sendStore.acceptRequest(password).then(() => history.push('/send/sent'));
};
handleChangePassword = ({ target: { value } }) => {
this.setState({ password: value });
};
handleReject = () => {
const { history, sendStore } = this.props;
sendStore
.rejectRequest()
.then(() => history.goBack())
.catch(() => history.goBack());
<Link to='/tokens' className='icon -close'>
Close
}
title={<h1>Send {token.name}</h1>}
/>
<div className='window_content'>
<div className='box -padded'>
<TokenBalance
drawers={[
<div key='txForm'>
<div className='form_field'>
<label>Amount</label>
<div className='form_field_value'>
</div>
</div>
<div className='form_field'>
<label>To</label>
<div className='form_field_value'>{tx.to}</div>
</div>
</div>,
<form key='signerForm' onSubmit={this.handleAccept}>
<div className='text'>
<p>Enter your password to confirm this transaction.</p>
<FormField
label='Password'
onChange={this.handleChangePassword}
required
type='password'
value={password}
/>
<nav className='form-nav -binary'>
<button
className='button -cancel'
onClick={this.handleReject}
type='button'
>
Cancel
</button>
<button
className='button -submit'
disabled={!txStatus || !txStatus.requested}
>
Confirm transaction
</button>
</nav>
</form>
]}
onClick={null}
token={token}
/>