From 3ea841e27621a8e9972677e46dbd8e3f0c002632 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 30 Aug 2017 16:07:46 -0230 Subject: Refactor gas-fee-display to include usd and eth fee displays as separate components. --- ui/app/components/send/usd-fee-display.js | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 ui/app/components/send/usd-fee-display.js (limited to 'ui/app/components/send/usd-fee-display.js') diff --git a/ui/app/components/send/usd-fee-display.js b/ui/app/components/send/usd-fee-display.js new file mode 100644 index 000000000..012bda550 --- /dev/null +++ b/ui/app/components/send/usd-fee-display.js @@ -0,0 +1,35 @@ +const Component = require('react').Component +const h = require('react-hyperscript') +const inherits = require('util').inherits +const FiatValue = require('../fiat-value') +const { getTxFeeBn } = require('../../util') + +module.exports = USDFeeDisplay + +inherits(USDFeeDisplay, Component) +function USDFeeDisplay () { + Component.call(this) +} + +USDFeeDisplay.prototype.render = function () { + const { + currentCurrency, + conversionRate, + gas, + gasPrice, + blockGasLimit, + } = this.props + + return h(FiatValue, { + value: getTxFeeBn(gas, gasPrice, blockGasLimit), + conversionRate, + currentCurrency, + style: { + color: '#5d5d5d', + fontSize: '16px', + fontFamily: 'DIN OT', + lineHeight: '22.4px' + } + }) +} + -- cgit From ca46bd200b24456d692cf1ede47506be5fdcc76d Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 13 Sep 2017 15:27:15 -0230 Subject: Stop setting 'currentCurrency' and use local state for active currency in send.js --- ui/app/components/send/usd-fee-display.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/app/components/send/usd-fee-display.js') diff --git a/ui/app/components/send/usd-fee-display.js b/ui/app/components/send/usd-fee-display.js index 012bda550..6ee38f1b5 100644 --- a/ui/app/components/send/usd-fee-display.js +++ b/ui/app/components/send/usd-fee-display.js @@ -13,7 +13,7 @@ function USDFeeDisplay () { USDFeeDisplay.prototype.render = function () { const { - currentCurrency, + activeCurrency, conversionRate, gas, gasPrice, @@ -23,7 +23,7 @@ USDFeeDisplay.prototype.render = function () { return h(FiatValue, { value: getTxFeeBn(gas, gasPrice, blockGasLimit), conversionRate, - currentCurrency, + currentCurrency: activeCurrency, style: { color: '#5d5d5d', fontSize: '16px', -- cgit From 56e9f98bd05de8ae26f653d15eec4304f0c72155 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 2 Nov 2017 09:45:59 -0230 Subject: More lint fixes --- ui/app/components/send/usd-fee-display.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/app/components/send/usd-fee-display.js') diff --git a/ui/app/components/send/usd-fee-display.js b/ui/app/components/send/usd-fee-display.js index 6ee38f1b5..4cf31a493 100644 --- a/ui/app/components/send/usd-fee-display.js +++ b/ui/app/components/send/usd-fee-display.js @@ -28,8 +28,8 @@ USDFeeDisplay.prototype.render = function () { color: '#5d5d5d', fontSize: '16px', fontFamily: 'DIN OT', - lineHeight: '22.4px' - } + lineHeight: '22.4px', + }, }) } -- cgit