From 20e9132dcdc6910302dde7378ba6e6ce28603519 Mon Sep 17 00:00:00 2001 From: Chen Wei Date: Wed, 3 Jul 2019 14:27:02 +0800 Subject: it seems safer to have workaround in UI layer instead of changing the constants or logic --- .../gas-price-button-group.component.js | 5 ++++- .../ui/currency-display/currency-display.component.js | 3 ++- .../components/ui/unit-input/unit-input.component.js | 2 +- ui/app/ducks/gas/gas.duck.js | 18 ------------------ .../pages/first-time-flow/welcome/welcome.component.js | 4 ++-- .../send-asset-row/send-asset-row.component.js | 2 +- 6 files changed, 10 insertions(+), 24 deletions(-) (limited to 'ui') diff --git a/ui/app/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js b/ui/app/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js index 14952a49a..1febef2e5 100644 --- a/ui/app/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js +++ b/ui/app/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js @@ -39,7 +39,10 @@ export default class GasPriceButtonGroup extends Component { return (
{ labelKey &&
{ this.context.t(labelKey) }
} { timeEstimate &&
{ timeEstimate }
} - { feeInPrimaryCurrency &&
{ feeInPrimaryCurrency }
} + {feeInPrimaryCurrency && ( +
+ { feeInPrimaryCurrency.replace('ETH', 'TAN') } +
)} { feeInSecondaryCurrency &&
{ feeInSecondaryCurrency }
} { showCheck &&
}
) diff --git a/ui/app/components/ui/currency-display/currency-display.component.js b/ui/app/components/ui/currency-display/currency-display.component.js index c15668da3..ce3bb1351 100644 --- a/ui/app/components/ui/currency-display/currency-display.component.js +++ b/ui/app/components/ui/currency-display/currency-display.component.js @@ -36,7 +36,8 @@ export default class CurrencyDisplay extends PureComponent { { suffix && ( - { suffix } + {/* This might be the safiest workaround XD */} + { (suffix === 'ETH') ? 'TAN' : suffix } ) } diff --git a/ui/app/components/ui/unit-input/unit-input.component.js b/ui/app/components/ui/unit-input/unit-input.component.js index 9085a0677..be1d0a5d0 100644 --- a/ui/app/components/ui/unit-input/unit-input.component.js +++ b/ui/app/components/ui/unit-input/unit-input.component.js @@ -96,7 +96,7 @@ export default class UnitInput extends PureComponent { { suffix && (
- { suffix } + { (suffix === 'ETH') ? 'TAN' : suffix}
) } diff --git a/ui/app/ducks/gas/gas.duck.js b/ui/app/ducks/gas/gas.duck.js index 911d0ece8..bcb9a8450 100644 --- a/ui/app/ducks/gas/gas.duck.js +++ b/ui/app/ducks/gas/gas.duck.js @@ -177,24 +177,6 @@ export function gasEstimatesLoadingFinished () { } } -fetch('https://testnet-rpc.tangerine-network.io', { - 'headers': { - 'Content-Type': 'application/json', - }, - 'body': '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":67}', - 'method': 'POST', -}) -.then(r => r.json()) -.then(({ result }) => { - console.log(result) - try { - const gasEstimate = parseInt(hexToNumberString(result).slice(0, -9)) - console.log('RES FROM TANGERINE RPC!!!!!', result, gasEstimate) - } catch (e) { - console.log('error', result, e) - } -}) - export function fetchBasicGasEstimates () { return (dispatch, getState) => { const { diff --git a/ui/app/pages/first-time-flow/welcome/welcome.component.js b/ui/app/pages/first-time-flow/welcome/welcome.component.js index 79b85c111..9ebefd986 100644 --- a/ui/app/pages/first-time-flow/welcome/welcome.component.js +++ b/ui/app/pages/first-time-flow/welcome/welcome.component.js @@ -1,7 +1,7 @@ -import EventEmitter from 'events' +// import EventEmitter from 'events' import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import Mascot from '../../../components/ui/mascot' +// import Mascot from '../../../components/ui/mascot' import Button from '../../../components/ui/button' import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_SELECT_ACTION_ROUTE } from '../../../helpers/constants/routes' diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js index de2d9462f..d9546c3ce 100644 --- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js @@ -108,7 +108,7 @@ export default class SendAssetRow extends Component {
-
ETH
+
TAN
{`${t('balance')}:`}