1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-12 20:57:12 +01:00
metamask-extension/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js

33 lines
936 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { compose } from 'redux';
import { withRouter } from 'react-router-dom';
import { rejectWatchAsset, acceptWatchAsset } from '../../store/actions';
import { getMostRecentOverviewPage } from '../../ducks/history/history';
import ConfirmAddSuggestedToken from './confirm-add-suggested-token.component';
const mapStateToProps = (state) => {
2020-11-03 00:41:28 +01:00
const {
metamask: { suggestedAssets, tokens },
} = state;
return {
mostRecentOverviewPage: getMostRecentOverviewPage(state),
suggestedAssets,
tokens,
};
};
2020-02-15 21:34:12 +01:00
const mapDispatchToProps = (dispatch) => {
return {
rejectWatchAsset: (suggestedAssetID) =>
dispatch(rejectWatchAsset(suggestedAssetID)),
acceptWatchAsset: (suggestedAssetID) =>
dispatch(acceptWatchAsset(suggestedAssetID)),
};
};
2018-08-16 23:28:07 +02:00
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps),
)(ConfirmAddSuggestedToken);