1
0
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:
Nidhi Kumari 2023-01-19 23:00:35 +05:30 committed by GitHub
parent 8f915807e4
commit 0fdff8955c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -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')}:`}

View File

@ -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),