From e4382daba2102d28a9a2e535e334c34340c84495 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Tue, 17 Nov 2020 17:58:12 -0800 Subject: [PATCH] Trying to implement BCHA prices --- src/components/admin-lte/index.js | 36 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index 32fa0a3..369ae46 100644 --- a/src/components/admin-lte/index.js +++ b/src/components/admin-lte/index.js @@ -60,18 +60,18 @@ class AdminLTEPage extends React.Component { - + -
+
{!_this.state.inFetch && ( -
+

{siteConfig.balanceText}

@@ -81,9 +81,9 @@ class AdminLTEPage extends React.Component { USD: ${_this.state.usdBalance}
@@ -101,8 +101,8 @@ class AdminLTEPage extends React.Component { - -
+ +
{_this.renderNewViewItems(_this.props)}
@@ -132,7 +132,17 @@ class AdminLTEPage extends React.Component { const myBalance = await bchWalletLib.getBalance() const bchjs = bchWalletLib.bchjs - const currentRate = await bchjs.Price.getUsd() * 100 + + let currentRate + + if (bchjs.restURL.includes('abc.fullstack')) { + currentRate = await bchjs.Price.getBchaUsd() + console.log(`currentRate: ${currentRate}`) + } else { + // BCHN price. + currentRate = (await bchjs.Price.getUsd()) * 100 + } + _this.setState({ currentRate: currentRate }) @@ -341,14 +351,14 @@ class AdminLTEPage extends React.Component { return '' }) ) - } catch (err) { } + } catch (err) {} } getInvisibleMenuItem () { return (
  • {/* Adding this childrens prevents console errors */} - +