1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
metamask-extension/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js
Alex Donesky 490d3b8d40
Integrate TokensController (#11552)
* Integrate controllers/tokensController

* address rebase issues

* small cleanup

* addressing feedback

* more feedback
2021-09-10 12:37:19 -05:00

33 lines
936 B
JavaScript

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) => {
const {
metamask: { suggestedAssets, tokens },
} = state;
return {
mostRecentOverviewPage: getMostRecentOverviewPage(state),
suggestedAssets,
tokens,
};
};
const mapDispatchToProps = (dispatch) => {
return {
rejectWatchAsset: (suggestedAssetID) =>
dispatch(rejectWatchAsset(suggestedAssetID)),
acceptWatchAsset: (suggestedAssetID) =>
dispatch(acceptWatchAsset(suggestedAssetID)),
};
};
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps),
)(ConfirmAddSuggestedToken);