1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 19:10:22 +01:00
metamask-extension/ui/app/components/send/currency-toggle.js

27 lines
743 B
JavaScript
Raw Normal View History

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',
2017-08-29 16:50:48 +02:00
onClick: () => onClick('ETH'),
}, ['ETH']),
'<>',
h('span', {
className: currentCurrency === 'USD' ? 'selected-currency' : 'unselected-currency',
2017-08-29 16:50:48 +02:00
onClick: () => onClick('USD'),
}, ['USD']),
2017-08-29 16:50:48 +02:00
]) // holding on icon from design
}