aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/token-list.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-08-08 01:52:08 +0800
committerkumavis <aaron@kumavis.me>2017-08-08 01:52:08 +0800
commit78aa957e5ab5bd3e7f7fb4628c82de8ae312750f (patch)
treeffe2ece4164b9d6c70196dd3ab608244bdf95281 /ui/app/components/token-list.js
parent82ba2c95ee98487dd465e5aabd45f18d46e89727 (diff)
parent57abc58d623b66a091987a944d8c45737f4feabe (diff)
downloadtangerine-wallet-browser-78aa957e5ab5bd3e7f7fb4628c82de8ae312750f.tar.gz
tangerine-wallet-browser-78aa957e5ab5bd3e7f7fb4628c82de8ae312750f.tar.zst
tangerine-wallet-browser-78aa957e5ab5bd3e7f7fb4628c82de8ae312750f.zip
Merge branch 'master' of github.com:MetaMask/metamask-extension into greenkeeper/initial
Diffstat (limited to 'ui/app/components/token-list.js')
-rw-r--r--ui/app/components/token-list.js42
1 files changed, 32 insertions, 10 deletions
diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js
index 20cfa897e..5ea31ae8d 100644
--- a/ui/app/components/token-list.js
+++ b/ui/app/components/token-list.js
@@ -47,10 +47,11 @@ TokenList.prototype.render = function () {
return h(TokenCell, tokenData)
})
- return h('div', [
- h('ol', {
+ return h('.full-flex-height', [
+ this.renderTokenStatusBar(),
+
+ h('ol.full-flex-height.flex-column', {
style: {
- height: '260px',
overflowY: 'auto',
display: 'flex',
flexDirection: 'column',
@@ -63,6 +64,7 @@ TokenList.prototype.render = function () {
flex-direction: row;
align-items: center;
padding: 10px;
+ min-height: 50px;
}
li.token-cell > h3 {
@@ -76,17 +78,37 @@ TokenList.prototype.render = function () {
`),
...tokenViews,
- tokenViews.length ? null : this.message('No Tokens Found.'),
+ h('.flex-grow'),
]),
- this.addTokenButtonElement(),
])
}
-TokenList.prototype.addTokenButtonElement = function () {
- return h('div', [
- h('div.footer.hover-white.pointer', {
+TokenList.prototype.renderTokenStatusBar = function () {
+ const { tokens } = this.state
+
+ let msg
+ if (tokens.length === 1) {
+ msg = `You own 1 token`
+ } else if (tokens.length === 1) {
+ msg = `You own ${tokens.length} tokens`
+ } else {
+ msg = `No tokens found`
+ }
+
+ return h('div', {
+ style: {
+ display: 'flex',
+ justifyContent: 'space-between',
+ alignItems: 'center',
+ minHeight: '70px',
+ padding: '10px',
+ },
+ }, [
+ h('span', msg),
+ h('button', {
key: 'reveal-account-bar',
- onClick: () => {
+ onClick: (event) => {
+ event.preventDefault()
this.props.addToken()
},
style: {
@@ -97,7 +119,7 @@ TokenList.prototype.addTokenButtonElement = function () {
alignItems: 'center',
},
}, [
- h('i.fa.fa-plus.fa-lg'),
+ 'ADD TOKEN',
]),
])
}