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:
parent
4b975adc85
commit
3f8cbd5202
@ -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 })
|
||||
|
@ -34,6 +34,7 @@ const mapStateToProps = (state) => {
|
||||
chainId,
|
||||
rpcPrefs: getRpcPrefsForCurrentProvider(state),
|
||||
tokenList,
|
||||
useTokenDetection,
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user