diff options
Add CurrencyDisplay and TokenCurrencyDisplay components
Diffstat (limited to 'ui/app/components/currency-display/currency-display.component.js')
-rw-r--r-- | ui/app/components/currency-display/currency-display.component.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ui/app/components/currency-display/currency-display.component.js b/ui/app/components/currency-display/currency-display.component.js new file mode 100644 index 000000000..f1bb933d7 --- /dev/null +++ b/ui/app/components/currency-display/currency-display.component.js @@ -0,0 +1,24 @@ +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' + +export default class CurrencyDisplay extends PureComponent { + static propTypes = { + className: PropTypes.string, + displayValue: PropTypes.string, + prefix: PropTypes.string, + } + + render () { + const { className, displayValue, prefix } = this.props + const text = `${prefix || ''}${displayValue}` + + return ( + <div + className={className} + title={text} + > + { text } + </div> + ) + } +} |