From 224337c4979de4a57c0d2fde49b1750e2a39bfb5 Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Mon, 14 Jan 2019 12:08:21 +0100 Subject: [PATCH] disable add account button when device is not connected --- .../components/AccountMenu/index.js | 52 ++++++++----------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/src/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js b/src/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js index 202632b5..a89f980a 100644 --- a/src/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js +++ b/src/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js @@ -71,24 +71,6 @@ const AddAccountIconWrapper = styled.div` margin-right: 12px; `; -const DiscoveryStatusWrapper = styled.div` - display: flex; - flex-direction: column; - width: 100%; - font-size: ${FONT_SIZE.BASE}; - padding: ${LEFT_NAVIGATION_ROW.PADDING}; - white-space: nowrap; - border-top: 1px solid ${colors.DIVIDER}; -`; - -const DiscoveryStatusText = styled.div` - display: block; - font-size: ${FONT_SIZE.SMALL}; - color: ${colors.TEXT_SECONDARY}; - overflow: hidden; - text-overflow: ellipsis; -`; - const DiscoveryLoadingWrapper = styled.div` display: flex; align-items: center; @@ -162,7 +144,28 @@ const AccountMenu = (props: Props) => { if (discovery && discovery.completed) { const lastAccount = deviceAccounts[deviceAccounts.length - 1]; - if (lastAccount && !lastAccount.empty) { + if (!selected.connected) { + discoveryStatus = ( + + + + + + + Add account + + + + ); + } else if (lastAccount && !lastAccount.empty) { discoveryStatus = ( @@ -199,17 +202,6 @@ const AccountMenu = (props: Props) => { ); } - } else if (!selected.connected) { - discoveryStatus = ( - - - Accounts could not be loaded - - {`Connect ${selected.instanceLabel} device`} - - - - ); } else { discoveryStatus = (