1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-12 20:57:12 +01:00
metamask-extension/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js
Erik Marks 76a2a9bb8b
@metamask/eslint config@5.0.0 (#10358)
* @metamask/eslint-config@5.0.0
* Update eslintrc and prettierrc
* yarn lint:fix
2021-02-04 10:15:23 -08:00

33 lines
1013 B
JavaScript

import { connect } from 'react-redux';
import { compose } from 'redux';
import { withRouter } from 'react-router-dom';
import { addToken, removeSuggestedTokens } from '../../store/actions';
import { getMostRecentOverviewPage } from '../../ducks/history/history';
import ConfirmAddSuggestedToken from './confirm-add-suggested-token.component';
const mapStateToProps = (state) => {
const {
metamask: { pendingTokens, suggestedTokens, tokens },
} = state;
const params = { ...pendingTokens, ...suggestedTokens };
return {
mostRecentOverviewPage: getMostRecentOverviewPage(state),
pendingTokens: params,
tokens,
};
};
const mapDispatchToProps = (dispatch) => {
return {
addToken: ({ address, symbol, decimals, image }) =>
dispatch(addToken(address, symbol, Number(decimals), image)),
removeSuggestedTokens: () => dispatch(removeSuggestedTokens()),
};
};
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps),
)(ConfirmAddSuggestedToken);