mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-25 03:20:23 +01:00
e10ddbe3a3
* add erc-721 token detection and flag to disable sending * addressing feedback * remove redundant provider instantiation * fix issue caused by unprotected destructuring * add tests and documentation * move add isERC721 flag to useTokenTracker hook * Update and unit tests * use memoizedTokens in useTokenTracker Co-authored-by: Dan Miller <danjm.com@gmail.com>
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { getNativeCurrency } from '../../../../ducks/metamask/metamask';
|
|
import {
|
|
getMetaMaskAccounts,
|
|
getNativeCurrencyImage,
|
|
getSendTokenAddress,
|
|
getAssetImages,
|
|
} from '../../../../selectors';
|
|
import { updateTokenType } from '../../../../store/actions';
|
|
import {
|
|
updateSendErrors,
|
|
updateSendToken,
|
|
} from '../../../../ducks/send/send.duck';
|
|
import SendAssetRow from './send-asset-row.component';
|
|
|
|
function mapStateToProps(state) {
|
|
return {
|
|
tokens: state.metamask.tokens,
|
|
selectedAddress: state.metamask.selectedAddress,
|
|
sendTokenAddress: getSendTokenAddress(state),
|
|
accounts: getMetaMaskAccounts(state),
|
|
nativeCurrency: getNativeCurrency(state),
|
|
nativeCurrencyImage: getNativeCurrencyImage(state),
|
|
assetImages: getAssetImages(state),
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
setSendToken: (token) => dispatch(updateSendToken(token)),
|
|
updateTokenType: (tokenAddress) => dispatch(updateTokenType(tokenAddress)),
|
|
updateSendErrors: (error) => {
|
|
dispatch(updateSendErrors(error));
|
|
},
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SendAssetRow);
|