1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Removing the token detection announcement when the token detection is ON (#12776)

This commit is contained in:
Niranjana Binoy 2021-11-29 13:28:35 -05:00 committed by GitHub
parent 4b975adc85
commit 3f8cbd5202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 18 deletions

View File

@ -44,6 +44,7 @@ class ImportToken extends Component {
chainId: PropTypes.string, chainId: PropTypes.string,
rpcPrefs: PropTypes.object, rpcPrefs: PropTypes.object,
tokenList: PropTypes.object, tokenList: PropTypes.object,
useTokenDetection: PropTypes.bool,
}; };
static defaultProps = { static defaultProps = {
@ -391,10 +392,11 @@ class ImportToken extends Component {
} }
renderSearchToken() { renderSearchToken() {
const { tokenList, history } = this.props; const { tokenList, history, useTokenDetection } = this.props;
const { tokenSelectorError, selectedTokens, searchResults } = this.state; const { tokenSelectorError, selectedTokens, searchResults } = this.state;
return ( return (
<div className="import-token__search-token"> <div className="import-token__search-token">
{!useTokenDetection && (
<ActionableMessage <ActionableMessage
message={this.context.t('tokenDetectionAnnouncement', [ message={this.context.t('tokenDetectionAnnouncement', [
<Button <Button
@ -411,6 +413,7 @@ class ImportToken extends Component {
iconFillColor="#037DD6" iconFillColor="#037DD6"
className="import-token__token-detection-announcement" className="import-token__token-detection-announcement"
/> />
)}
<TokenSearch <TokenSearch
onSearch={({ results = [] }) => onSearch={({ results = [] }) =>
this.setState({ searchResults: results }) this.setState({ searchResults: results })

View File

@ -34,6 +34,7 @@ const mapStateToProps = (state) => {
chainId, chainId,
rpcPrefs: getRpcPrefsForCurrentProvider(state), rpcPrefs: getRpcPrefsForCurrentProvider(state),
tokenList, tokenList,
useTokenDetection,
}; };
}; };

View File

@ -21,7 +21,7 @@
} }
&__search-token { &__search-token {
padding: 0 16px 16px 16px; padding: 16px 16px 16px 16px;
} }
&__token-list { &__token-list {
@ -57,5 +57,6 @@
&__token-detection-announcement { &__token-detection-announcement {
margin-bottom: 16px; margin-bottom: 16px;
margin-top: 0;
} }
} }