diff options
author | Dan <danjm.com@gmail.com> | 2018-04-07 06:29:51 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-04-07 06:29:51 +0800 |
commit | 284dd85a99f538b77fd477f4952117d1792f64a5 (patch) | |
tree | 419bc3a56f01d818a98a6bb3ff21cec8434be093 /ui/app/components/send_/send-content/send-to-row/send-to-row.component.js | |
parent | 77486a23654a7709091f99bc7ef76d894a46113a (diff) | |
download | tangerine-wallet-browser-284dd85a99f538b77fd477f4952117d1792f64a5.tar.gz tangerine-wallet-browser-284dd85a99f538b77fd477f4952117d1792f64a5.tar.zst tangerine-wallet-browser-284dd85a99f538b77fd477f4952117d1792f64a5.zip |
first commit
Diffstat (limited to 'ui/app/components/send_/send-content/send-to-row/send-to-row.component.js')
-rw-r--r-- | ui/app/components/send_/send-content/send-to-row/send-to-row.component.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/ui/app/components/send_/send-content/send-to-row/send-to-row.component.js b/ui/app/components/send_/send-content/send-to-row/send-to-row.component.js new file mode 100644 index 000000000..abcb54efc --- /dev/null +++ b/ui/app/components/send_/send-content/send-to-row/send-to-row.component.js @@ -0,0 +1,62 @@ +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import SendRowWrapper from '../../../send/from-dropdown' +import ToDropdown from '../../../ens-input' + +export default class SendToRow extends Component { + + static propTypes = { + to: PropTypes.string, + toAccounts: PropTypes.array, + toDropdownOpen: PropTypes.bool, + inError: PropTypes.bool, + updateSendTo: PropTypes.func, + updateSendToError: PropTypes.func, + openToDropdown: PropTypes.func, + closeToDropdown: PropTypes.func, + network: PropTypes.number, + }; + + handleToChange (to, nickname = '') { + const { updateSendTo, updateSendToError } = this.props + updateSendTo(to, nickname) + updateSendErrors(to) + } + + render () { + const { + from, + fromAccounts, + conversionRate, + fromDropdownOpen, + tokenContract, + openToDropdown, + closeToDropdown, + network, + inError, + } = this.props + + return ( + <SendRowWrapper label={`${this.context.t('to')}:`}> + <EnsInput + name={'address'} + placeholder={this.context.t('recipient Address')} + network={network}, + to={to}, + accounts={toAccounts} + dropdownOpen={toDropdownOpen} + openDropdown={() => openToDropdown()} + closeDropdown={() => closeToDropdown()} + onChange={this.handleToChange} + inError={inError} + /> + </SendRowWrapper> + ); + } + +} + +SendToRow.contextTypes = { + t: PropTypes.func, +} + |