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,
rpcPrefs: PropTypes.object,
tokenList: PropTypes.object,
useTokenDetection: PropTypes.bool,
};
static defaultProps = {
@ -391,26 +392,28 @@ class ImportToken extends Component {
}
renderSearchToken() {
const { tokenList, history } = this.props;
const { tokenList, history, useTokenDetection } = this.props;
const { tokenSelectorError, selectedTokens, searchResults } = this.state;
return (
<div className="import-token__search-token">
<ActionableMessage
message={this.context.t('tokenDetectionAnnouncement', [
<Button
type="link"
key="token-detection-announcement"
className="import-token__link"
onClick={() => history.push(EXPERIMENTAL_ROUTE)}
>
{this.context.t('enableFromSettings')}
</Button>,
])}
withRightButton
useIcon
iconFillColor="#037DD6"
className="import-token__token-detection-announcement"
/>
{!useTokenDetection && (
<ActionableMessage
message={this.context.t('tokenDetectionAnnouncement', [
<Button
type="link"
key="token-detection-announcement"
className="import-token__link"
onClick={() => history.push(EXPERIMENTAL_ROUTE)}
>
{this.context.t('enableFromSettings')}
</Button>,
])}
withRightButton
useIcon
iconFillColor="#037DD6"
className="import-token__token-detection-announcement"
/>
)}
<TokenSearch
onSearch={({ results = [] }) =>
this.setState({ searchResults: results })

View File

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

View File

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