aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/account-list-item.js
blob: b11527d9558f835bfdf8d2ebcf0c5c17a8e1aa8f (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
47
48
49
50
51
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const Identicon = require('../identicon')

inherits(AccountListItem, Component)
function AccountListItem () {
  Component.call(this)
}

module.exports = AccountListItem

AccountListItem.prototype.render = function () {
  const {
    account, 
    handleClick, 
    icon = null,
  } = this.props

  const { identity, balancesToRender } = account
  const { name, address } = identity
  const { primary, secondary } = balancesToRender

  return h('div.account-list-item', {
    onClick: () => handleClick(identity),
  }, [

    h('div.account-list-item__top-row', {}, [

      h(
        Identicon,
        {
          address,
          diameter: 18,
          className: 'account-list-item__identicon',
        },
      ),  

      h('div.account-list-item__account-name', {}, name),

      icon && h('div.account-list-item__icon', [icon]),

    ]),

    h('div.account-list-item__account-primary-balance', {}, primary),

    h('div.account-list-item__account-secondary-balance', {}, secondary),

  ])
}