aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/send-content/send-from-row/from-dropdown/from-dropdown.component.js
blob: d512f7d0b89d873b392cec6ad30b78ff7bc58c9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import AccountListItem from '../../../account-list-item/'
import SendDropdownList from '../../send-dropdown-list/'

export default class FromDropdown extends Component {

  static propTypes = {
    accounts: PropTypes.array,
    closeDropdown: PropTypes.func,
    dropdownOpen: PropTypes.bool,
    onSelect: PropTypes.func,
    openDropdown: PropTypes.func,
    selectedAccount: PropTypes.object,
  }

  static contextTypes = {
    t: PropTypes.func,
  }

  render () {
    const {
      accounts,
      closeDropdown,
      dropdownOpen,
      openDropdown,
      selectedAccount,
      onSelect,
    } = this.props

    return <div className="send-v2__from-dropdown">
      <AccountListItem
        account={selectedAccount}
        handleClick={openDropdown}
        icon={<i className={`fa fa-caret-down fa-lg`} style={ { color: '#dedede' } }/>}
      />
      {dropdownOpen && <SendDropdownList
        accounts={accounts}
        closeDropdown={closeDropdown}
        onSelect={onSelect}
        activeAddress={selectedAccount.address}
      />}
    </div>
  }

}