diff --git a/packages/react-components/src/AddressMini.tsx b/packages/react-components/src/AddressMini.tsx index baef767cec..c9e8709698 100644 --- a/packages/react-components/src/AddressMini.tsx +++ b/packages/react-components/src/AddressMini.tsx @@ -11,7 +11,7 @@ import styled from 'styled-components'; import { AccountName } from '@polkadot/react-query'; import { KeyringItemType } from '@polkadot/ui-keyring/types'; -import { classes } from './util'; +import { classes, toShortAddress } from './util'; import BalanceDisplay from './Balance'; import BondedDisplay from './Bonded'; import IdentityIcon from './IdentityIcon'; @@ -30,10 +30,11 @@ interface Props extends BareProps { withBalance?: boolean; withBonded?: boolean; withLockedVote?: boolean; + withName?: boolean; } function AddressMini (props: Props): React.ReactElement | null { - const { balance, bonded, children, className, iconInfo, isPadded = true, style, value, withAddress = true, withBalance = false, withBonded = false, withLockedVote = false } = props; + const { balance, bonded, children, className, iconInfo, isPadded = true, style, value, withAddress = true, withBalance = false, withBonded = false, withLockedVote = false, withName = true } = props; if (!value) { return null; @@ -49,7 +50,10 @@ function AddressMini (props: Props): React.ReactElement | null {
{withAddress && (
- + {withName + ? + : toShortAddress(address) + }
)} {children} diff --git a/packages/react-components/src/InputAddress/index.tsx b/packages/react-components/src/InputAddress/index.tsx index 8d9c0323c5..27a59da25a 100644 --- a/packages/react-components/src/InputAddress/index.tsx +++ b/packages/react-components/src/InputAddress/index.tsx @@ -256,7 +256,7 @@ class InputAddress extends React.PureComponent { const queryLower = query.toLowerCase(); const matches = filteredOptions.filter((item): boolean => item.value !== null && ( - item.name.toLowerCase().includes(queryLower) || + (item.name.toLowerCase && item.name.toLowerCase().includes(queryLower)) || item.value.toLowerCase().includes(queryLower) ) ); diff --git a/packages/react-components/src/Status/index.tsx b/packages/react-components/src/Status/index.tsx index 61952f6926..ff8523072f 100644 --- a/packages/react-components/src/Status/index.tsx +++ b/packages/react-components/src/Status/index.tsx @@ -68,7 +68,7 @@ function signerIconName (status: QueueTxStatus): any { function renderStatus ({ account, action, id, message, removeItem, status }: QueueStatus): React.ReactNode { const addressRendered = account - ? + ? : undefined; return (