diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-13 16:25:39 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-13 16:25:39 +0800 |
commit | 8f31b05ac5b7d8383c720b8b0c9f7f3cecc937f5 (patch) | |
tree | 09d0ab5b98acc83034ff98f6b97e28b8753c7f42 /ui/app/components/send/currency-toggle.js | |
parent | 8b5f2a95df45c24061c13c51ca874e933e743381 (diff) | |
download | tangerine-wallet-browser-8f31b05ac5b7d8383c720b8b0c9f7f3cecc937f5.tar tangerine-wallet-browser-8f31b05ac5b7d8383c720b8b0c9f7f3cecc937f5.tar.gz tangerine-wallet-browser-8f31b05ac5b7d8383c720b8b0c9f7f3cecc937f5.tar.bz2 tangerine-wallet-browser-8f31b05ac5b7d8383c720b8b0c9f7f3cecc937f5.tar.lz tangerine-wallet-browser-8f31b05ac5b7d8383c720b8b0c9f7f3cecc937f5.tar.xz tangerine-wallet-browser-8f31b05ac5b7d8383c720b8b0c9f7f3cecc937f5.tar.zst tangerine-wallet-browser-8f31b05ac5b7d8383c720b8b0c9f7f3cecc937f5.zip |
Add token exchange rates
Diffstat (limited to 'ui/app/components/send/currency-toggle.js')
-rw-r--r-- | ui/app/components/send/currency-toggle.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ui/app/components/send/currency-toggle.js b/ui/app/components/send/currency-toggle.js index 2b59ace4a..d777f0aea 100644 --- a/ui/app/components/send/currency-toggle.js +++ b/ui/app/components/send/currency-toggle.js @@ -12,11 +12,11 @@ function CurrencyToggle () { const defaultCurrencies = [ 'ETH', 'USD' ] -CurrencyToggle.prototype.render = function () { +CurrencyToggle.prototype.renderToggles = function () { const { onClick, currentCurrency } = this.props const [currencyA, currencyB] = this.props.currencies || defaultCurrencies - return h('span.currency-toggle', {}, [ + return [ h('span', { className: classnames('currency-toggle__item', { 'currency-toggle__item--selected': currencyA === currentCurrency, @@ -30,6 +30,15 @@ CurrencyToggle.prototype.render = function () { }), onClick: () => onClick(currencyB), }, [ currencyB ]), - ]) // holding on icon from design + ] +} + +CurrencyToggle.prototype.render = function () { + const currencies = this.props.currencies || defaultCurrencies + + return h('span.currency-toggle', currencies.length + ? this.renderToggles() + : [] + ) } |