diff --git a/src/components/addresses/picker/PickerHints.tsx b/src/components/addresses/picker/PickerHints.tsx index 72655c8..e0c2438 100644 --- a/src/components/addresses/picker/PickerHints.tsx +++ b/src/components/addresses/picker/PickerHints.tsx @@ -144,10 +144,15 @@ }; }, [lookupHint]); + // Whether or not to show certain hints/anything at all + const showWalletHint = !!foundWallet; + const showAddressHint = foundAddress !== undefined; + const showNameHint = foundName !== undefined; + const foundAnything = showWalletHint || showAddressHint || showNameHint; + // Whether or not to show a separator between the wallet hint and address or // name hint (i.e. if two hints are shown) - const showSep = !!foundWallet && (!!foundAddress || !!foundName); - const foundAnything = !!foundWallet || !!foundAddress || !!foundName; + const showSep = showWalletHint && (showAddressHint || showNameHint); if (foundAnything) return
{/* Show a wallet hint if possible */} @@ -157,12 +162,12 @@ {showSep && } {/* Show an address hint if possible */} - {foundAddress !== undefined && ( + {showAddressHint && ( )} {/* Show a name hint if possible */} - {foundName !== undefined && } + {showNameHint && }
; return null;