2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import {
|
|
|
|
getMetaMaskAccounts,
|
2021-02-11 19:20:08 +01:00
|
|
|
getNativeCurrency,
|
2021-04-02 00:57:00 +02:00
|
|
|
getNativeCurrencyImage,
|
2021-02-04 19:15:23 +01:00
|
|
|
getSendTokenAddress,
|
|
|
|
} from '../../../../selectors';
|
|
|
|
import { updateSendToken } from '../../../../store/actions';
|
|
|
|
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-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-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);
|