2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
2021-06-08 18:03:59 +02:00
|
|
|
import { getNativeCurrency } from '../../../../ducks/metamask/metamask';
|
2021-02-04 19:15:23 +01:00
|
|
|
import {
|
|
|
|
getMetaMaskAccounts,
|
2021-04-02 00:57:00 +02:00
|
|
|
getNativeCurrencyImage,
|
2021-02-04 19:15:23 +01:00
|
|
|
getSendTokenAddress,
|
2021-04-28 07:07:43 +02:00
|
|
|
getAssetImages,
|
2021-02-04 19:15:23 +01:00
|
|
|
} from '../../../../selectors';
|
2021-06-22 19:39:44 +02:00
|
|
|
import { updateTokenType } from '../../../../store/actions';
|
|
|
|
import {
|
|
|
|
updateSendErrors,
|
|
|
|
updateSendToken,
|
|
|
|
} from '../../../../ducks/send/send.duck';
|
2021-02-04 19:15:23 +01:00
|
|
|
import SendAssetRow from './send-asset-row.component';
|
2019-04-17 21:15:13 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
function mapStateToProps(state) {
|
2019-04-17 21:15:13 +02:00
|
|
|
return {
|
|
|
|
tokens: state.metamask.tokens,
|
|
|
|
selectedAddress: state.metamask.selectedAddress,
|
2020-05-29 19:46:10 +02:00
|
|
|
sendTokenAddress: getSendTokenAddress(state),
|
2019-04-17 21:15:13 +02:00
|
|
|
accounts: getMetaMaskAccounts(state),
|
2021-02-11 19:20:08 +01:00
|
|
|
nativeCurrency: getNativeCurrency(state),
|
2021-04-02 00:57:00 +02:00
|
|
|
nativeCurrencyImage: getNativeCurrencyImage(state),
|
2021-04-28 07:07:43 +02:00
|
|
|
assetImages: getAssetImages(state),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-04-17 21:15:13 +02:00
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
function mapDispatchToProps(dispatch) {
|
2019-04-17 21:15:13 +02:00
|
|
|
return {
|
2020-06-01 19:54:32 +02:00
|
|
|
setSendToken: (token) => dispatch(updateSendToken(token)),
|
2021-06-22 19:39:44 +02:00
|
|
|
updateTokenType: (tokenAddress) => dispatch(updateTokenType(tokenAddress)),
|
|
|
|
updateSendErrors: (error) => {
|
|
|
|
dispatch(updateSendErrors(error));
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-04-17 21:15:13 +02:00
|
|
|
}
|
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SendAssetRow);
|