diff options
author | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-12-14 10:19:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 10:19:36 +0800 |
commit | 30a2be85eebe4f6b8cddb297f14faba392fe1133 (patch) | |
tree | 34cec0a1910e9e16bbed103d4b0f65f61724f8fb /ui/app/components/send/send-content/send-from-row/send-from-row.component.js | |
parent | 435fdae84ac49b1366b8737215d97bd82002dccf (diff) | |
download | tangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.tar.gz tangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.tar.zst tangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.zip |
Prevent users from changing the From field in the send screen (#5922)
* Prevent users from changing the From field in the send screen
* Fix integration tests
Diffstat (limited to 'ui/app/components/send/send-content/send-from-row/send-from-row.component.js')
-rw-r--r-- | ui/app/components/send/send-content/send-from-row/send-from-row.component.js | 51 |
1 files changed, 7 insertions, 44 deletions
diff --git a/ui/app/components/send/send-content/send-from-row/send-from-row.component.js b/ui/app/components/send/send-content/send-from-row/send-from-row.component.js index b6de9d222..f8aa084d8 100644 --- a/ui/app/components/send/send-content/send-from-row/send-from-row.component.js +++ b/ui/app/components/send/send-content/send-from-row/send-from-row.component.js @@ -1,64 +1,27 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import SendRowWrapper from '../send-row-wrapper/' -import FromDropdown from './from-dropdown/' +import AccountListItem from '../../account-list-item' export default class SendFromRow extends Component { - static propTypes = { - closeFromDropdown: PropTypes.func, - conversionRate: PropTypes.number, from: PropTypes.object, - fromAccounts: PropTypes.array, - fromDropdownOpen: PropTypes.bool, - openFromDropdown: PropTypes.func, - tokenContract: PropTypes.object, - updateSendFrom: PropTypes.func, - setSendTokenBalance: PropTypes.func, } static contextTypes = { t: PropTypes.func, } - async handleFromChange (newFrom) { - const { - updateSendFrom, - tokenContract, - setSendTokenBalance, - } = this.props - - if (tokenContract) { - const usersToken = await tokenContract.balanceOf(newFrom.address) - setSendTokenBalance(usersToken) - } - - updateSendFrom(newFrom) - } - render () { - const { - closeFromDropdown, - conversionRate, - from, - fromAccounts, - fromDropdownOpen, - openFromDropdown, - } = this.props + const { t } = this.context + const { from } = this.props return ( - <SendRowWrapper label={`${this.context.t('from')}:`}> - <FromDropdown - accounts={fromAccounts} - closeDropdown={() => closeFromDropdown()} - conversionRate={conversionRate} - dropdownOpen={fromDropdownOpen} - onSelect={newFrom => this.handleFromChange(newFrom)} - openDropdown={() => openFromDropdown()} - selectedAccount={from} - /> + <SendRowWrapper label={`${t('from')}:`}> + <div className="send-v2__from-dropdown"> + <AccountListItem account={from} /> + </div> </SendRowWrapper> ) } - } |