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