@@ -5,7 +5,7 @@ import { PopOver } from 'react-polymorph/lib/components/PopOver';
55import { defineMessages , intlShape } from 'react-intl' ;
66import { observer } from 'mobx-react' ;
77import styles from './Asset.scss' ;
8- import { ellipsis } from '../../utils/strings' ;
8+ import { ellipsis , hexToString } from '../../utils/strings' ;
99import AssetContent from './AssetContent' ;
1010import settingsIcon from '../../assets/images/asset-token-settings-ic.inline.svg' ;
1111import warningIcon from '../../assets/images/asset-token-warning-ic.inline.svg' ;
@@ -173,8 +173,18 @@ class Asset extends Component<Props, State> {
173173 hasWarning,
174174 hasError,
175175 } = this . props ;
176- const { fingerprint, metadata, decimals, recommendedDecimals } = asset ;
177- const { name } = metadata || { } ;
176+ const {
177+ fingerprint,
178+ metadata,
179+ decimals,
180+ recommendedDecimals,
181+ assetName,
182+ } = asset ;
183+ const hasName = ! ! metadata ?. name ;
184+ const name = metadata ?. name || `ASCII: ${ hexToString ( assetName ) } ` ;
185+ const displayName = metadataNameChars
186+ ? ellipsis ( name , metadataNameChars )
187+ : name ;
178188 const contentStyles = classnames ( [
179189 styles . pill ,
180190 hasError ? styles . error : null ,
@@ -196,9 +206,14 @@ class Asset extends Component<Props, State> {
196206 ? fingerprint
197207 : ellipsis ( fingerprint || '' , startCharAmount , endCharAmount ) }
198208 </ div >
199- { name && (
200- < div className = { styles . metadataName } >
201- { metadataNameChars ? ellipsis ( name , metadataNameChars ) : name }
209+ { displayName && (
210+ < div
211+ className = { classnames (
212+ styles . metadataName ,
213+ ! hasName && styles . ascii
214+ ) }
215+ >
216+ { displayName }
202217 </ div >
203218 ) }
204219 { hasWarning && (
0 commit comments