You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
4 years ago
|
import { connect } from 'react-redux';
|
||
7 years ago
|
|
||
4 years ago
|
import { setPendingTokens, clearPendingTokens } from '../../store/actions';
|
||
|
import { getMostRecentOverviewPage } from '../../ducks/history/history';
|
||
4 years ago
|
import {
|
||
|
getIsMainnet,
|
||
|
getRpcPrefsForCurrentProvider,
|
||
3 years ago
|
getTokenList,
|
||
4 years ago
|
} from '../../selectors/selectors';
|
||
3 years ago
|
import ImportToken from './import-token.component';
|
||
7 years ago
|
|
||
5 years ago
|
const mapStateToProps = (state) => {
|
||
4 years ago
|
const {
|
||
4 years ago
|
metamask: {
|
||
|
identities,
|
||
|
tokens,
|
||
|
pendingTokens,
|
||
|
provider: { chainId },
|
||
|
},
|
||
4 years ago
|
} = state;
|
||
7 years ago
|
return {
|
||
|
identities,
|
||
5 years ago
|
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
||
7 years ago
|
tokens,
|
||
|
pendingTokens,
|
||
4 years ago
|
showSearchTab: getIsMainnet(state) || process.env.IN_TEST === 'true',
|
||
4 years ago
|
chainId,
|
||
|
rpcPrefs: getRpcPrefsForCurrentProvider(state),
|
||
3 years ago
|
tokenList: getTokenList(state),
|
||
4 years ago
|
};
|
||
|
};
|
||
7 years ago
|
|
||
5 years ago
|
const mapDispatchToProps = (dispatch) => {
|
||
7 years ago
|
return {
|
||
5 years ago
|
setPendingTokens: (tokens) => dispatch(setPendingTokens(tokens)),
|
||
7 years ago
|
clearPendingTokens: () => dispatch(clearPendingTokens()),
|
||
4 years ago
|
};
|
||
|
};
|
||
7 years ago
|
|
||
3 years ago
|
export default connect(mapStateToProps, mapDispatchToProps)(ImportToken);
|