aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/token-balance
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@users.noreply.github.com>2018-11-20 08:06:34 +0800
committerGitHub <noreply@github.com>2018-11-20 08:06:34 +0800
commit4c87c05a02d5bf5634234a74910e5d3e559dd413 (patch)
tree638338429538e6bc62b5ad812c11e1f7925fe184 /ui/app/components/token-balance
parent7fe37276a17cbbcb566a0650603eb5ed6115179b (diff)
downloadtangerine-wallet-browser-4c87c05a02d5bf5634234a74910e5d3e559dd413.tar.gz
tangerine-wallet-browser-4c87c05a02d5bf5634234a74910e5d3e559dd413.tar.zst
tangerine-wallet-browser-4c87c05a02d5bf5634234a74910e5d3e559dd413.zip
Fix rounding issue when sending max tokens (#5695)
* Fix rounding issue when sending max tokens * Ensure amount row shows exact amount of max tokens on send screen (#2) * Fix tests * Change stored redux value from BigNumber to hex string. Fix TokenInput default value
Diffstat (limited to 'ui/app/components/token-balance')
-rw-r--r--ui/app/components/token-balance/index.scss14
-rw-r--r--ui/app/components/token-balance/token-balance.component.js12
2 files changed, 21 insertions, 5 deletions
diff --git a/ui/app/components/token-balance/index.scss b/ui/app/components/token-balance/index.scss
new file mode 100644
index 000000000..2ff6dfbc8
--- /dev/null
+++ b/ui/app/components/token-balance/index.scss
@@ -0,0 +1,14 @@
+.token-balance-component {
+ display: flex;
+ align-items: center;
+
+ &__text {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ &__suffix {
+ padding-left: 4px;
+ }
+}
diff --git a/ui/app/components/token-balance/token-balance.component.js b/ui/app/components/token-balance/token-balance.component.js
index 2b4f73980..af1a32578 100644
--- a/ui/app/components/token-balance/token-balance.component.js
+++ b/ui/app/components/token-balance/token-balance.component.js
@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
-import classnames from 'classnames'
+import CurrencyDisplay from '../currency-display'
export default class TokenBalance extends PureComponent {
static propTypes = {
@@ -12,12 +12,14 @@ export default class TokenBalance extends PureComponent {
}
render () {
- const { className, string, withSymbol, symbol } = this.props
+ const { className, string, symbol } = this.props
return (
- <div className={classnames('hide-text-overflow', className)}>
- { string + (withSymbol ? ` ${symbol}` : '') }
- </div>
+ <CurrencyDisplay
+ className={className}
+ displayValue={string}
+ suffix={symbol}
+ />
)
}
}