mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
added title for each nft in asset dropdown (#17286)
This commit is contained in:
parent
8f915807e4
commit
0fdff8955c
@ -46,6 +46,12 @@ export default class SendAssetRow extends Component {
|
||||
}),
|
||||
}),
|
||||
),
|
||||
collections: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
address: PropTypes.string.isRequired,
|
||||
name: PropTypes.string,
|
||||
}),
|
||||
),
|
||||
};
|
||||
|
||||
static contextTypes = {
|
||||
@ -261,7 +267,9 @@ export default class SendAssetRow extends Component {
|
||||
renderCollectible(collectible, insideDropdown = false) {
|
||||
const { address, name, image, tokenId } = collectible;
|
||||
const { t } = this.context;
|
||||
|
||||
const collectibleCollection = this.props.collections.find(
|
||||
(collection) => collection.address === address,
|
||||
);
|
||||
return (
|
||||
<div
|
||||
key={address}
|
||||
@ -272,7 +280,9 @@ export default class SendAssetRow extends Component {
|
||||
<Identicon address={address} diameter={36} image={image} />
|
||||
</div>
|
||||
<div className="send-v2__asset-dropdown__asset-data">
|
||||
<div className="send-v2__asset-dropdown__symbol">{name}</div>
|
||||
<div className="send-v2__asset-dropdown__symbol">
|
||||
{collectibleCollection.name || name}
|
||||
</div>
|
||||
<div className="send-v2__asset-dropdown__name">
|
||||
<span className="send-v2__asset-dropdown__name__label">
|
||||
{`${t('tokenId')}:`}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
getCollectibleContracts,
|
||||
getCollectibles,
|
||||
getNativeCurrency,
|
||||
} from '../../../../ducks/metamask/metamask';
|
||||
@ -15,6 +16,7 @@ function mapStateToProps(state) {
|
||||
tokens: state.metamask.tokens,
|
||||
selectedAddress: state.metamask.selectedAddress,
|
||||
collectibles: getCollectibles(state),
|
||||
collections: getCollectibleContracts(state),
|
||||
sendAsset: getSendAsset(state),
|
||||
accounts: getMetaMaskAccounts(state),
|
||||
nativeCurrency: getNativeCurrency(state),
|
||||
|
Loading…
Reference in New Issue
Block a user