aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-09-22 09:44:52 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-22 09:44:52 +0800
commit3ec2f534632426876c28b22c58cbbf14b4904d97 (patch)
treeed84f2703e86a29a7db43a4ecabac308a0cbe7bb /ui/app/components
parent24fd16b1bee31352ef7f364804eb5f06c08c3bf6 (diff)
downloadtangerine-wallet-browser-3ec2f534632426876c28b22c58cbbf14b4904d97.tar.gz
tangerine-wallet-browser-3ec2f534632426876c28b22c58cbbf14b4904d97.tar.zst
tangerine-wallet-browser-3ec2f534632426876c28b22c58cbbf14b4904d97.zip
Integrate Add Token
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/token-balance.js14
-rw-r--r--ui/app/components/tx-list.js2
2 files changed, 10 insertions, 6 deletions
diff --git a/ui/app/components/token-balance.js b/ui/app/components/token-balance.js
index 3a923eb9d..0342c1da9 100644
--- a/ui/app/components/token-balance.js
+++ b/ui/app/components/token-balance.js
@@ -17,7 +17,8 @@ module.exports = connect(mapStateToProps)(TokenBalance)
inherits(TokenBalance, Component)
function TokenBalance () {
this.state = {
- balance: '',
+ string: '',
+ symbol: '',
isLoading: true,
error: null,
}
@@ -26,11 +27,14 @@ function TokenBalance () {
TokenBalance.prototype.render = function () {
const state = this.state
- const { balance, isLoading } = state
+ const { symbol, string, balanceOnly, isLoading } = state
return isLoading
? h('span', '')
- : h('span', balance)
+ : h('span.token-balance', [
+ h('span.token-balance__amount', string),
+ !balanceOnly && h('span.token-balance__symbol', symbol),
+ ])
}
TokenBalance.prototype.componentDidMount = function () {
@@ -93,10 +97,10 @@ TokenBalance.prototype.componentDidUpdate = function (nextProps) {
TokenBalance.prototype.updateBalance = function (tokens = []) {
const [{ string, symbol }] = tokens
- const { balanceOnly } = this.props
this.setState({
- balance: balanceOnly ? string : `${string} ${symbol}`,
+ string,
+ symbol,
isLoading: false,
})
}
diff --git a/ui/app/components/tx-list.js b/ui/app/components/tx-list.js
index 7a147e942..f817d03a9 100644
--- a/ui/app/components/tx-list.js
+++ b/ui/app/components/tx-list.js
@@ -77,7 +77,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
const { showConfTxPage } = this.props
const opts = {
- key: transActionId,
+ key: transActionId || transactionHash,
txParams: transaction.txParams,
transactionStatus,
transActionId,