Adding search tab in import tokens for custom networks (#12110)

feature/default_network_editable
Niranjana Binoy 3 years ago committed by GitHub
parent 74fa6fa187
commit 49ddc48592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      shared/constants/network.js
  2. 15
      ui/pages/import-token/import-token.container.js

@ -122,6 +122,7 @@ export const NATIVE_CURRENCY_TOKEN_IMAGE_MAP = {
[ETH_SYMBOL]: ETH_TOKEN_IMAGE_URL,
[TEST_ETH_SYMBOL]: TEST_ETH_TOKEN_IMAGE_URL,
[BNB_SYMBOL]: BNB_TOKEN_IMAGE_URL,
[MATIC_SYMBOL]: MATIC_TOKEN_IMAGE_URL,
};
export const INFURA_BLOCKED_KEY = 'countryBlocked';

@ -3,9 +3,8 @@ import { connect } from 'react-redux';
import { setPendingTokens, clearPendingTokens } from '../../store/actions';
import { getMostRecentOverviewPage } from '../../ducks/history/history';
import {
getIsMainnet,
getRpcPrefsForCurrentProvider,
getTokenList,
getIsMainnet,
} from '../../selectors/selectors';
import ImportToken from './import-token.component';
@ -16,17 +15,25 @@ const mapStateToProps = (state) => {
tokens,
pendingTokens,
provider: { chainId },
useTokenDetection,
tokenList,
},
} = state;
const showSearchTabCustomNetwork =
useTokenDetection && Boolean(Object.keys(tokenList).length);
const showSearchTab =
getIsMainnet(state) ||
showSearchTabCustomNetwork ||
process.env.IN_TEST === 'true';
return {
identities,
mostRecentOverviewPage: getMostRecentOverviewPage(state),
tokens,
pendingTokens,
showSearchTab: getIsMainnet(state) || process.env.IN_TEST === 'true',
showSearchTab,
chainId,
rpcPrefs: getRpcPrefsForCurrentProvider(state),
tokenList: getTokenList(state),
tokenList,
};
};

Loading…
Cancel
Save