mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 21:00:13 +01:00
c1e3c229bc
See [`import/order`](https://eslint.org/docs/rules/import/order) for more information. This change enables `import/order` and fixes the issues raised by the rule.
30 lines
987 B
JavaScript
30 lines
987 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)
|