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,
|
2017-10-19 04:09:26 +02:00
|
|
|
primaryCurrency = 'ETH',
|
|
|
|
convertedCurrency,
|
2017-10-13 22:19:22 +02:00
|
|
|
} = this.props
|
|
|
|
|
2017-10-19 19:53:56 +02:00
|
|
|
return h('div.send-v2__gas-fee-display', [
|
2017-10-13 22:19:22 +02:00
|
|
|
|
2017-10-17 19:22:23 +02:00
|
|
|
gasTotal
|
2017-10-13 22:19:22 +02:00
|
|
|
? h(CurrencyDisplay, {
|
2017-11-02 03:30:33 +01:00
|
|
|
primaryCurrency,
|
2017-10-19 04:09:26 +02:00
|
|
|
convertedCurrency,
|
2017-10-17 19:22:23 +02:00
|
|
|
value: gasTotal,
|
2017-10-13 22:19:22 +02:00
|
|
|
conversionRate,
|
|
|
|
convertedPrefix: '$',
|
|
|
|
readOnly: true,
|
|
|
|
})
|
2017-11-02 13:15:59 +01:00
|
|
|
: h('div.currency-display', 'Loading...'),
|
2017-10-13 22:19:22 +02:00
|
|
|
|
|
|
|
h('div.send-v2__sliders-icon-container', {
|
|
|
|
onClick,
|
|
|
|
}, [
|
|
|
|
h('i.fa.fa-sliders.send-v2__sliders-icon'),
|
2017-11-02 13:15:59 +01:00
|
|
|
]),
|
2017-10-13 22:19:22 +02:00
|
|
|
|
|
|
|
])
|
|
|
|
}
|
|
|
|
|