diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2019-04-25 03:25:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 03:25:39 +0800 |
commit | 87d5be9081fd3ab3bfb4ae67d5cab4b8a8304a8a (patch) | |
tree | 2230335f440e36c23f47e0794e94cf6b0b312024 /ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js | |
parent | 8c98e89e617b594d4f0ee54a8437e30201688090 (diff) | |
parent | 6a60562d6649d88f24bd849b325871bb256a0001 (diff) | |
download | tangerine-wallet-browser-87d5be9081fd3ab3bfb4ae67d5cab4b8a8304a8a.tar.gz tangerine-wallet-browser-87d5be9081fd3ab3bfb4ae67d5cab4b8a8304a8a.tar.zst tangerine-wallet-browser-87d5be9081fd3ab3bfb4ae67d5cab4b8a8304a8a.zip |
Merge pull request #6484 from MetaMask/develop
Update master branch with develop (v6.4.0)
Diffstat (limited to 'ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js')
-rw-r--r-- | ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js b/ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js new file mode 100644 index 000000000..0d026bc69 --- /dev/null +++ b/ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js @@ -0,0 +1,52 @@ +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import AccountListItem from '../../account-list-item' + +export default class SendDropdownList extends Component { + + static propTypes = { + accounts: PropTypes.array, + closeDropdown: PropTypes.func, + onSelect: PropTypes.func, + activeAddress: PropTypes.string, + }; + + static contextTypes = { + t: PropTypes.func, + }; + + getListItemIcon (accountAddress, activeAddress) { + return accountAddress === activeAddress + ? <i className={`fa fa-check fa-lg`} style={ { color: '#02c9b1' } }/> + : null + } + + render () { + const { + accounts, + closeDropdown, + onSelect, + activeAddress, + } = this.props + + return (<div> + <div + className="send-v2__from-dropdown__close-area" + onClick={() => closeDropdown()} + /> + <div className="send-v2__from-dropdown__list"> + {accounts.map((account, index) => <AccountListItem + account={account} + className="account-list-item__dropdown" + handleClick={() => { + onSelect(account) + closeDropdown() + }} + icon={this.getListItemIcon(account.address, activeAddress)} + key={`send-dropdown-account-#${index}`} + />)} + </div> + </div>) + } + +} |