aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/currency-display/currency-display.component.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@users.noreply.github.com>2018-10-17 07:03:29 +0800
committerGitHub <noreply@github.com>2018-10-17 07:03:29 +0800
commitbadebe017fe28b58ac742082368484c3a4b1c1bc (patch)
treeb0810d259ea104a11051dd48dc1038a9c2d82310 /ui/app/components/currency-display/currency-display.component.js
parent8bccb88132447882f81105a0033a4f199200714f (diff)
downloadtangerine-wallet-browser-badebe017fe28b58ac742082368484c3a4b1c1bc.tar.gz
tangerine-wallet-browser-badebe017fe28b58ac742082368484c3a4b1c1bc.tar.zst
tangerine-wallet-browser-badebe017fe28b58ac742082368484c3a4b1c1bc.zip
Adds toggle for primary currency (#5421)
* Add UnitInput component * Add CurrencyInput component * Add UserPreferencedCurrencyInput component * Add UserPreferencedCurrencyDisplay component * Add updatePreferences action * Add styles for CurrencyInput, CurrencyDisplay, and UnitInput * Update SettingsTab page with Primary Currency toggle * Refactor currency displays and inputs to use UserPreferenced displays and inputs * Add TokenInput component * Add UserPreferencedTokenInput component * Use TokenInput in the send screen * Fix unit tests * Fix e2e and integration tests * Remove send/CurrencyDisplay component * Replace diamond unicode character with Eth logo. Fix typos
Diffstat (limited to 'ui/app/components/currency-display/currency-display.component.js')
-rw-r--r--ui/app/components/currency-display/currency-display.component.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/app/components/currency-display/currency-display.component.js b/ui/app/components/currency-display/currency-display.component.js
index e4eb58a2a..5f5717be3 100644
--- a/ui/app/components/currency-display/currency-display.component.js
+++ b/ui/app/components/currency-display/currency-display.component.js
@@ -1,5 +1,6 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
+import classnames from 'classnames'
import { ETH, GWEI } from '../../constants/common'
export default class CurrencyDisplay extends PureComponent {
@@ -7,6 +8,8 @@ export default class CurrencyDisplay extends PureComponent {
className: PropTypes.string,
displayValue: PropTypes.string,
prefix: PropTypes.string,
+ prefixComponent: PropTypes.node,
+ style: PropTypes.object,
// Used in container
currency: PropTypes.oneOf([ETH]),
denomination: PropTypes.oneOf([GWEI]),
@@ -16,15 +19,17 @@ export default class CurrencyDisplay extends PureComponent {
}
render () {
- const { className, displayValue, prefix } = this.props
+ const { className, displayValue, prefix, prefixComponent, style } = this.props
const text = `${prefix || ''}${displayValue}`
return (
<div
- className={className}
+ className={classnames('currency-display-component', className)}
+ style={style}
title={text}
>
- { text }
+ { prefixComponent}
+ <span className="currency-display-component__text">{ text }</span>
</div>
)
}