1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +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 = { static contextTypes = {
@ -261,7 +267,9 @@ export default class SendAssetRow extends Component {
renderCollectible(collectible, insideDropdown = false) { renderCollectible(collectible, insideDropdown = false) {
const { address, name, image, tokenId } = collectible; const { address, name, image, tokenId } = collectible;
const { t } = this.context; const { t } = this.context;
const collectibleCollection = this.props.collections.find(
(collection) => collection.address === address,
);
return ( return (
<div <div
key={address} key={address}
@ -272,7 +280,9 @@ export default class SendAssetRow extends Component {
<Identicon address={address} diameter={36} image={image} /> <Identicon address={address} diameter={36} image={image} />
</div> </div>
<div className="send-v2__asset-dropdown__asset-data"> <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"> <div className="send-v2__asset-dropdown__name">
<span className="send-v2__asset-dropdown__name__label"> <span className="send-v2__asset-dropdown__name__label">
{`${t('tokenId')}:`} {`${t('tokenId')}:`}

View File

@ -1,5 +1,6 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { import {
getCollectibleContracts,
getCollectibles, getCollectibles,
getNativeCurrency, getNativeCurrency,
} from '../../../../ducks/metamask/metamask'; } from '../../../../ducks/metamask/metamask';
@ -15,6 +16,7 @@ function mapStateToProps(state) {
tokens: state.metamask.tokens, tokens: state.metamask.tokens,
selectedAddress: state.metamask.selectedAddress, selectedAddress: state.metamask.selectedAddress,
collectibles: getCollectibles(state), collectibles: getCollectibles(state),
collections: getCollectibleContracts(state),
sendAsset: getSendAsset(state), sendAsset: getSendAsset(state),
accounts: getMetaMaskAccounts(state), accounts: getMetaMaskAccounts(state),
nativeCurrency: getNativeCurrency(state), nativeCurrency: getNativeCurrency(state),