From a534830dfff08b4bce8bba3bc0ad323aa47d5a3a Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Mon, 22 Oct 2018 10:02:30 +0200 Subject: [PATCH] discovery status css fix - DiscoveryStatusWrapper css fix (wodth 100%) - rewriten first condition --- .../components/AccountMenu/index.js | 107 +++++++++--------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/src/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js b/src/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js index dfd38016..06d9a216 100644 --- a/src/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js +++ b/src/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js @@ -78,7 +78,7 @@ const AddAccountIconWrapper = styled.div` const DiscoveryStatusWrapper = styled.div` display: flex; flex-direction: column; - + width: 100%; font-size: ${FONT_SIZE.SMALL}; padding: ${LEFT_NAVIGATION_ROW.PADDING}; white-space: nowrap; @@ -164,15 +164,34 @@ const AccountMenu = (props: Props) => { let discoveryStatus = null; const discovery = props.discovery.find(d => d.deviceState === selected.state && d.network === location.state.network); - if (discovery) { - if (discovery.completed) { - // TODO: add only if last one is not empty - //if (selectedAccounts.length > 0 && selectedAccounts[selectedAccounts.length - 1]) - const lastAccount = deviceAccounts[deviceAccounts.length - 1]; - if (lastAccount && (new BigNumber(lastAccount.balance).greaterThan(0) || lastAccount.nonce > 0)) { - discoveryStatus = ( - - + if (discovery && discovery.completed) { + // TODO: add only if last one is not empty + //if (selectedAccounts.length > 0 && selectedAccounts[selectedAccounts.length - 1]) + const lastAccount = deviceAccounts[deviceAccounts.length - 1]; + if (lastAccount && (new BigNumber(lastAccount.balance).greaterThan(0) || lastAccount.nonce > 0)) { + discoveryStatus = ( + + + + + + Add account + + + ); + } else { + discoveryStatus = ( + To add a new account, last account must have some transactions.} + placement="bottom" + > + + { Add account - ); - } else { - discoveryStatus = ( - To add a new account, last account must have some transactions.} - placement="bottom" - > - - - - - - Add account - - - - ); - } - } else if (!selected.connected || !selected.available) { - discoveryStatus = ( - - - Accounts could not be loaded - - {`Connect ${selected.instanceLabel} device`} - - - - ); - } else { - discoveryStatus = ( - - - - - Loading... - - - + ); } + } else if (!selected.connected) { + discoveryStatus = ( + + + Accounts could not be loaded + + {`Connect ${selected.instanceLabel} device`} + + + + ); + } else { + discoveryStatus = ( + + + + + Loading... + + + + ); } + return (