diff options
author | Dan <danjm.com@gmail.com> | 2017-08-29 21:55:11 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-08-31 07:46:24 +0800 |
commit | 1485ec7392a03a9b3a63262e0ecf0d90f0713251 (patch) | |
tree | b5c5c14f88b87abdab09882c8eb556f8d95e2527 /ui/app/components | |
parent | 3ce69e1b65dc4e12c51400d01b973cb0d0c79e7a (diff) | |
download | tangerine-wallet-browser-1485ec7392a03a9b3a63262e0ecf0d90f0713251.tar.gz tangerine-wallet-browser-1485ec7392a03a9b3a63262e0ecf0d90f0713251.tar.zst tangerine-wallet-browser-1485ec7392a03a9b3a63262e0ecf0d90f0713251.zip |
Move currency toggle to its own component.
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/send/currency-toggle.js | 26 | ||||
-rw-r--r-- | ui/app/components/send/gas-tooltip.js (renamed from ui/app/components/gas-tooltip.js) | 2 |
2 files changed, 27 insertions, 1 deletions
diff --git a/ui/app/components/send/currency-toggle.js b/ui/app/components/send/currency-toggle.js new file mode 100644 index 000000000..37c026542 --- /dev/null +++ b/ui/app/components/send/currency-toggle.js @@ -0,0 +1,26 @@ +const Component = require('react').Component +const h = require('react-hyperscript') +const inherits = require('util').inherits +module.exports = CurrencyToggle + +inherits(CurrencyToggle, Component) +function CurrencyToggle () { + Component.call(this) +} + +CurrencyToggle.prototype.render = function () { + const { onClick, currentCurrency } = this.props + + return h('span', {}, [ + h('span', { + className: currentCurrency === 'ETH' ? 'selected-currency' : 'unselected-currency', + onClick: () => onClick('ETH') + }, ['ETH']), + '<>', + h('span', { + className: currentCurrency === 'USD' ? 'selected-currency' : 'unselected-currency', + onClick: () => onClick('USD'), + }, ['USD']), + ]) //holding on icon from design +} + diff --git a/ui/app/components/gas-tooltip.js b/ui/app/components/send/gas-tooltip.js index 68b7aea61..472a8e287 100644 --- a/ui/app/components/gas-tooltip.js +++ b/ui/app/components/send/gas-tooltip.js @@ -1,7 +1,7 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits -const InputNumber = require('./input-number.js') +const InputNumber = require('../input-number.js') const findDOMNode = require('react-dom').findDOMNode module.exports = GasTooltip |