aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/account-list-item.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-10 07:17:52 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-10 09:24:14 +0800
commit71d6463984f040b2aa495a13429f6ea3505defaf (patch)
treef10f80e5de5b80f8e9967f1fccb0ab129cf266b2 /ui/app/components/send/account-list-item.js
parent80463072b5c0c9e826582e066fbc962b667ee355 (diff)
downloadtangerine-wallet-browser-71d6463984f040b2aa495a13429f6ea3505defaf.tar.gz
tangerine-wallet-browser-71d6463984f040b2aa495a13429f6ea3505defaf.tar.zst
tangerine-wallet-browser-71d6463984f040b2aa495a13429f6ea3505defaf.zip
Refactor 'rendersingleidentity' to a stand alone account-list-item component.
Diffstat (limited to 'ui/app/components/send/account-list-item.js')
-rw-r--r--ui/app/components/send/account-list-item.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/ui/app/components/send/account-list-item.js b/ui/app/components/send/account-list-item.js
new file mode 100644
index 000000000..b11527d95
--- /dev/null
+++ b/ui/app/components/send/account-list-item.js
@@ -0,0 +1,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),
+
+ ])
+} \ No newline at end of file