From 01c48b5c2eceebe03242d79a54836c87ea39d836 Mon Sep 17 00:00:00 2001 From: ixv Date: Fri, 21 May 2021 15:37:28 -0700 Subject: [PATCH] btc: connection status styling --- pkg/btc-wallet/src/js/components/lib/body.js | 4 +- .../src/js/components/lib/header.js | 42 ++++++++++++++----- .../src/js/components/lib/settings.js | 14 +++++-- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/pkg/btc-wallet/src/js/components/lib/body.js b/pkg/btc-wallet/src/js/components/lib/body.js index 2c0555d47d..29dc8559ef 100644 --- a/pkg/btc-wallet/src/js/components/lib/body.js +++ b/pkg/btc-wallet/src/js/components/lib/body.js @@ -43,7 +43,7 @@ export default class Body extends Component { flexDirection='column' width='400px' > -
+
-
+
{ (!this.props.warning) ? null : } diff --git a/pkg/btc-wallet/src/js/components/lib/header.js b/pkg/btc-wallet/src/js/components/lib/header.js index 9c0744fb91..9b6225effb 100644 --- a/pkg/btc-wallet/src/js/components/lib/header.js +++ b/pkg/btc-wallet/src/js/components/lib/header.js @@ -17,6 +17,23 @@ export default class Header extends Component { let icon = this.props.settings ? "X" : "Adjust"; let iconColor = this.props.settings ? "black" : "orange"; let iconLink = this.props.settings ? "/~btc" : "/~btc/settings"; + + let connection = null; + let badge = null; + if (!(this.props.state.provider && this.props.state.provider.connected)) { + connection = + + Provider Offline + + + if (!this.props.settings) { + badge = + + } + } + + + return ( - - - - - + + {connection} + + + {badge} + + + + ); } diff --git a/pkg/btc-wallet/src/js/components/lib/settings.js b/pkg/btc-wallet/src/js/components/lib/settings.js index e5d08f3ebd..445e527504 100644 --- a/pkg/btc-wallet/src/js/components/lib/settings.js +++ b/pkg/btc-wallet/src/js/components/lib/settings.js @@ -26,11 +26,17 @@ export default class Settings extends Component { } render() { - let conn = 'Not Connected' + let connColor = "red"; + let connBackground = "veryLightRed"; + let conn = 'Offline' let host = ''; if (this.props.state.provider){ if (this.props.state.provider.connected) conn = 'Connected'; if (this.props.state.provider.host) host = this.props.state.provider.host; + if (this.props.state.provider.connected && this.props.state.provider.host) { + connColor = "orange"; + connBackground = "lightOrange"; + } } return ( @@ -85,14 +91,14 @@ export default class Settings extends Component { py={5} px="36px" borderRadius="12px" - backgroundColor="lightOrange" + backgroundColor={connBackground} alignItems="center" justifyContent="space-between" > - + ~{host} - + {conn}