From b324fed8519d62d27664360b6a0f1baef2b0e512 Mon Sep 17 00:00:00 2001 From: kennybll Date: Sat, 15 Dec 2018 13:48:08 -0500 Subject: [PATCH 1/2] Adds the word TESTNET to footer when using a testnet node --- .../stylesheets/themes/_theme-template.scss | 3 +++ app/components/Layout/Footer.jsx | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/themes/_theme-template.scss b/app/assets/stylesheets/themes/_theme-template.scss index 4b0960ca32..0ee7d50728 100644 --- a/app/assets/stylesheets/themes/_theme-template.scss +++ b/app/assets/stylesheets/themes/_theme-template.scss @@ -2009,6 +2009,9 @@ } .footer { div.footer-status { + > span.testnet { + font-size: 0.85rem; + } > span.success { color: $success-color; } diff --git a/app/components/Layout/Footer.jsx b/app/components/Layout/Footer.jsx index 4e1b6f158e..7d6a791299 100644 --- a/app/components/Layout/Footer.jsx +++ b/app/components/Layout/Footer.jsx @@ -183,13 +183,17 @@ class Footer extends React.Component { return currentNode; } - getNode(node = {url: "", operator: ""}) { + getNode(node = {url: "", operator: "", region: ""}) { if (!node || !node.url) { throw "Node is undefined of has no url"; } const {props} = this; + let testNet; + if (node.region) testNet = node.region.startsWith("TESTNET"); + else testNet = false; + let title = node.operator + " " + !!node.location ? node.location : ""; if ("country" in node) { title = node.country + (!!title ? " - " + title : ""); @@ -201,7 +205,8 @@ class Footer extends React.Component { ping: node.url in props.apiLatencies ? props.apiLatencies[node.url] - : -1 + : -1, + testNet }; } @@ -592,6 +597,11 @@ class Footer extends React.Component { }} >
+ {connected && activeNode.testNet && ( + + {" "} + + )} {!connected ? ( @@ -611,9 +621,8 @@ class Footer extends React.Component { {!connected ? "-" : !activeNode.ping - ? "-" - : activeNode.ping + - "ms"} + ? "-" + : activeNode.ping + "ms"}  /  From f63952d53ae4e7d4235086e53b9930a3d4e3d3a9 Mon Sep 17 00:00:00 2001 From: kennybll Date: Thu, 20 Dec 2018 09:26:26 -0500 Subject: [PATCH 2/2] Changes the testnet check --- app/components/Layout/Footer.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/components/Layout/Footer.jsx b/app/components/Layout/Footer.jsx index 7d6a791299..58c48a2555 100644 --- a/app/components/Layout/Footer.jsx +++ b/app/components/Layout/Footer.jsx @@ -183,16 +183,14 @@ class Footer extends React.Component { return currentNode; } - getNode(node = {url: "", operator: "", region: ""}) { + getNode(node = {url: "", operator: ""}) { if (!node || !node.url) { throw "Node is undefined of has no url"; } const {props} = this; - let testNet; - if (node.region) testNet = node.region.startsWith("TESTNET"); - else testNet = false; + const testNet = node.url.indexOf("testnet") !== -1; let title = node.operator + " " + !!node.location ? node.location : ""; if ("country" in node) {