2017-10-13 22:19:22 +02:00
|
|
|
const Component = require('react').Component
|
|
|
|
const h = require('react-hyperscript')
|
|
|
|
const inherits = require('util').inherits
|
2017-10-17 19:22:23 +02:00
|
|
|
const CurrencyDisplay = require('./currency-display')
|
2017-10-13 22:19:22 +02:00
|
|
|
|
|
|
|
module.exports = GasFeeDisplay
|
|
|
|
|
|
|
|
inherits(GasFeeDisplay, Component)
|
|
|
|
function GasFeeDisplay () {
|
|
|
|
Component.call(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
GasFeeDisplay.prototype.render = function () {
|
|
|
|
const {
|
|
|
|
conversionRate,
|
2017-10-17 19:22:23 +02:00
|
|
|
gasTotal,
|
2017-10-13 22:19:22 +02:00
|
|
|
onClick,
|
|
|
|
} = this.props
|
|
|
|
|
|
|
|
return h('div', [
|
|
|
|
|
2017-10-17 19:22:23 +02:00
|
|
|
gasTotal
|
2017-10-13 22:19:22 +02:00
|
|
|
? h(CurrencyDisplay, {
|
|
|
|
primaryCurrency: 'ETH',
|
|
|
|
convertedCurrency: 'USD',
|
2017-10-17 19:22:23 +02:00
|
|
|
value: gasTotal,
|
2017-10-13 22:19:22 +02:00
|
|
|
conversionRate,
|
|
|
|
convertedPrefix: '$',
|
|
|
|
readOnly: true,
|
|
|
|
})
|
|
|
|
: h('div.currency-display', 'Loading...')
|
|
|
|
,
|
|
|
|
|
|
|
|
h('div.send-v2__sliders-icon-container', {
|
|
|
|
onClick,
|
|
|
|
}, [
|
|
|
|
h('i.fa.fa-sliders.send-v2__sliders-icon'),
|
|
|
|
])
|
|
|
|
|
|
|
|
])
|
|
|
|
}
|
|
|
|
|