Newer
Older
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
import React, { Component } from 'react';
import { Field, Form } from 'react-final-form';
import { Form as FetherForm, Header } from 'fether-ui';
import { inject, observer } from 'mobx-react';
import { Link, Redirect } from 'react-router-dom';
import { withProps } from 'recompose';
import TokenBalance from '../../Tokens/TokensList/TokenBalance';
@withProps(({ match: { params: { tokenAddress } }, tokensStore }) => ({
token: tokensStore.tokens[tokenAddress]
}))
const { history, sendStore, token } = this.props;
this.setState({ isSending: true }, () => {
sendStore
.then(() => history.push(`/send/${token.address}/sent`))
this.setState({ error, isSending: false });
handleChangePassword = ({ target: { value } }) => {
this.setState({ error: null, password: value });
if (!tx || !token) {
return <Redirect to={`/`} />;
}
<Link to='/tokens' className='icon -close'>
Close
title={token && <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>,
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<Form
key='signerForm'
onSubmit={this.handleAccept}
render={({ handleSubmit, submitting, valid }) => (
<form onSubmit={handleSubmit}>
<div className='text'>
<p>Enter your password to confirm this transaction.</p>
</div>
<Field
label='Password'
render={FetherForm.Field}
required
type='password'
/>
<nav className='form-nav -binary'>
<button
className='button -cancel'
onClick={history.goBack}
type='button'
>
Cancel
</button>
<button
className='button -submit'
disabled={!valid || submitting}
>
Confirm transaction
</button>
</nav>
</form>
)}
/>
]}
onClick={null}
token={token}
/>