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')
|
2018-01-25 06:41:29 +01:00
|
|
|
const t = require('../../../i18n')
|
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,
|
|
|
|
})
|
2018-01-24 09:14:47 +01:00
|
|
|
: h('div.currency-display', t('loading')),
|
2017-10-13 22:19:22 +02:00
|
|
|
|
2018-01-18 05:47:01 +01:00
|
|
|
h('button.send-v2__sliders-icon-container', {
|
2017-10-13 22:19:22 +02:00
|
|
|
onClick,
|
2018-01-18 05:47:01 +01:00
|
|
|
disabled: !gasTotal,
|
2017-10-13 22:19:22 +02:00
|
|
|
}, [
|
|
|
|
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
|
|
|
|
|
|
|
])
|
|
|
|
}
|