diff --git a/packages/extension-ui/src/components/Address.tsx b/packages/extension-ui/src/components/Address.tsx index 3338abe8..1aca7c9c 100644 --- a/packages/extension-ui/src/components/Address.tsx +++ b/packages/extension-ui/src/components/Address.tsx @@ -35,7 +35,7 @@ interface Props { genesisHash?: string | null; isExternal?: boolean | null; isHidden?: boolean; - name?: React.ReactNode | null; + name?: string | null; parentName?: string | null; suri?: string; toggleActions?: number; @@ -124,18 +124,23 @@ function Address ({ actions, address, children, className, genesisHash, isExtern [address, isHidden] ); - const displayedName = ( - <> - {(account?.isExternal || isExternal) && ( - - )} - {name || account?.name || t('')} - > - ); + const Name = () => { + const displayName = name || account?.name || t(''); + + return ( + <> + {(account?.isExternal || isExternal) && ( + + )} + {displayName} + >); + }; + + const parentNameSuri = `${parentName || ''} ${suri || ''}`; return ( @@ -160,11 +165,14 @@ function Address ({ actions, address, children, className, genesisHash, isExtern - {parentName} {suri || ''} + {parentNameSuri} - {displayedName} + + + > ) : ( @@ -172,7 +180,7 @@ function Address ({ actions, address, children, className, genesisHash, isExtern className='name' data-field='name' > - {displayedName} + ) } @@ -332,6 +340,7 @@ export default styled(Address)(({ theme }: ThemeProps) => ` overflow: hidden; text-overflow: ellipsis; width: 300px; + white-space: nowrap; &.displaced { padding-top: 10px; @@ -346,6 +355,7 @@ export default styled(Address)(({ theme }: ThemeProps) => ` padding: 0.25rem 0 0 0.8rem; text-overflow: ellipsis; width: 270px; + white-space: nowrap; } .fullAddress {