// Copyright 2015, 2016 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // Parity is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { observer } from 'mobx-react'; import { pick } from 'lodash'; import ActionDoneAll from 'material-ui/svg-icons/action/done-all'; import ContentClear from 'material-ui/svg-icons/content/clear'; import NavigationArrowBack from 'material-ui/svg-icons/navigation/arrow-back'; import NavigationArrowForward from 'material-ui/svg-icons/navigation/arrow-forward'; import { newError } from '~/ui/Errors/actions'; import { BusyStep, CompletedStep, Button, IdentityIcon, Modal, TxHash, Input } from '~/ui'; import { nullableProptype } from '~/util/proptypes'; import Details from './Details'; import Extras from './Extras'; import TransferStore from './store'; import styles from './transfer.css'; @observer class Transfer extends Component { static contextTypes = { api: PropTypes.object.isRequired } static propTypes = { newError: PropTypes.func.isRequired, gasLimit: PropTypes.object.isRequired, images: PropTypes.object.isRequired, senders: nullableProptype(PropTypes.object), sendersBalances: nullableProptype(PropTypes.object), account: PropTypes.object, balance: PropTypes.object, wallet: PropTypes.object, onClose: PropTypes.func } store = new TransferStore(this.context.api, this.props); render () { const { stage, extras, steps } = this.store; return ( { this.renderWarning() } { this.renderPage() } ); } renderAccount () { const { account } = this.props; return (
{ account.name || 'Unnamed' }
{ account.address }
); } renderPage () { const { extras, stage } = this.store; if (stage === 0) { return this.renderDetailsPage(); } else if (stage === 1 && extras) { return this.renderExtrasPage(); } return this.renderCompletePage(); } renderCompletePage () { const { sending, txhash, busyState, rejected } = this.store; if (rejected) { return ( ); } if (sending) { return ( ); } return ( { this.store.operation ? (

This transaction needs confirmation from other owners.

) : null }
); } renderDetailsPage () { const { account, balance, images, senders } = this.props; const { recipient, recipientError, sender, senderError, sendersBalances } = this.store; const { valueAll, extras, tag, total, totalError, value, valueError } = this.store; return (
); } renderExtrasPage () { if (!this.store.gasStore.histogram) { return null; } const { isEth, data, dataError, total, totalError } = this.store; return ( ); } renderDialogActions () { const { account } = this.props; const { extras, sending, stage } = this.store; const cancelBtn = (