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
|
|
|
} from '../../../../selectors';
|
2021-06-23 23:35:25 +02:00
|
|
|
import { updateSendAsset, getSendAssetAddress } from '../../../../ducks/send';
|
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,
|
2021-06-23 23:35:25 +02:00
|
|
|
sendAssetAddress: getSendAssetAddress(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-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 {
|
2021-06-23 23:35:25 +02:00
|
|
|
updateSendAsset: ({ type, details }) =>
|
|
|
|
dispatch(updateSendAsset({ type, details })),
|
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);
|