|
|
|
@ -52,13 +52,16 @@ export default function ItemList({ |
|
|
|
|
|
|
|
|
|
// If there is a token for import based on a contract address, it's the only one in the list.
|
|
|
|
|
const hasTokenForImport = results.length === 1 && results[0].notImported; |
|
|
|
|
const placeholder = Placeholder ? ( |
|
|
|
|
<Placeholder searchQuery={searchQuery} /> |
|
|
|
|
) : null; |
|
|
|
|
return results.length === 0 ? ( |
|
|
|
|
Placeholder && <Placeholder searchQuery={searchQuery} /> |
|
|
|
|
placeholder |
|
|
|
|
) : ( |
|
|
|
|
<div className="searchable-item-list"> |
|
|
|
|
{listTitle && ( |
|
|
|
|
{listTitle ? ( |
|
|
|
|
<div className="searchable-item-list__title">{listTitle}</div> |
|
|
|
|
)} |
|
|
|
|
) : null} |
|
|
|
|
<div |
|
|
|
|
className={classnames( |
|
|
|
|
'searchable-item-list__list-container', |
|
|
|
@ -100,43 +103,43 @@ export default function ItemList({ |
|
|
|
|
onKeyUp={(e) => e.key === 'Enter' && onClick()} |
|
|
|
|
key={`searchable-item-list-item-${i}`} |
|
|
|
|
> |
|
|
|
|
{(iconUrl || primaryLabel) && ( |
|
|
|
|
{iconUrl || primaryLabel ? ( |
|
|
|
|
<UrlIcon url={iconUrl} name={primaryLabel} /> |
|
|
|
|
)} |
|
|
|
|
{!(iconUrl || primaryLabel) && identiconAddress && ( |
|
|
|
|
) : null} |
|
|
|
|
{!(iconUrl || primaryLabel) && identiconAddress ? ( |
|
|
|
|
<div className="searchable-item-list__identicon"> |
|
|
|
|
<Identicon address={identiconAddress} diameter={24} /> |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
{IconComponent && <IconComponent />} |
|
|
|
|
) : null} |
|
|
|
|
{IconComponent ? <IconComponent /> : null} |
|
|
|
|
<div className="searchable-item-list__labels"> |
|
|
|
|
<div className="searchable-item-list__item-labels"> |
|
|
|
|
{primaryLabel && ( |
|
|
|
|
{primaryLabel ? ( |
|
|
|
|
<span className="searchable-item-list__primary-label"> |
|
|
|
|
{primaryLabel} |
|
|
|
|
</span> |
|
|
|
|
)} |
|
|
|
|
{secondaryLabel && ( |
|
|
|
|
) : null} |
|
|
|
|
{secondaryLabel ? ( |
|
|
|
|
<span className="searchable-item-list__secondary-label"> |
|
|
|
|
{secondaryLabel} |
|
|
|
|
</span> |
|
|
|
|
)} |
|
|
|
|
) : null} |
|
|
|
|
</div> |
|
|
|
|
{!hideRightLabels && |
|
|
|
|
(rightPrimaryLabel || rightSecondaryLabel) && ( |
|
|
|
|
(rightPrimaryLabel || rightSecondaryLabel) ? ( |
|
|
|
|
<div className="searchable-item-list__right-labels"> |
|
|
|
|
{rightPrimaryLabel && ( |
|
|
|
|
{rightPrimaryLabel ? ( |
|
|
|
|
<span className="searchable-item-list__right-primary-label"> |
|
|
|
|
{rightPrimaryLabel} |
|
|
|
|
</span> |
|
|
|
|
)} |
|
|
|
|
{rightSecondaryLabel && ( |
|
|
|
|
) : null} |
|
|
|
|
{rightSecondaryLabel ? ( |
|
|
|
|
<span className="searchable-item-list__right-secondary-label"> |
|
|
|
|
{rightSecondaryLabel} |
|
|
|
|
</span> |
|
|
|
|
)} |
|
|
|
|
) : null} |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
) : null} |
|
|
|
|
</div> |
|
|
|
|
{result.notImported && ( |
|
|
|
|
<Button type="confirm" onClick={onClick}> |
|
|
|
|