1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 04:20:53 +01:00

Adding a Token detection announcement in Search tab (#12152)

This commit is contained in:
Niranjana Binoy 2021-09-20 15:42:58 -04:00 committed by GitHub
parent 3ca6202282
commit 9929820b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 3 deletions

View File

@ -748,6 +748,9 @@
"editPermission": { "editPermission": {
"message": "Edit Permission" "message": "Edit Permission"
}, },
"enableFromSettings": {
"message": " Enable it from Settings."
},
"encryptionPublicKeyNotice": { "encryptionPublicKeyNotice": {
"message": "$1 would like your public encryption key. By consenting, this site will be able to compose encrypted messages to you.", "message": "$1 would like your public encryption key. By consenting, this site will be able to compose encrypted messages to you.",
"description": "$1 is the web3 site name" "description": "$1 is the web3 site name"
@ -2570,6 +2573,9 @@
"tokenDecimalFetchFailed": { "tokenDecimalFetchFailed": {
"message": "Token decimal required." "message": "Token decimal required."
}, },
"tokenDetectionAnnouncement": {
"message": "New! Improved token detection is available on Ethereum Mainnet as an experimental feature. $1"
},
"tokenSymbol": { "tokenSymbol": {
"message": "Token Symbol" "message": "Token Symbol"
}, },

View File

@ -6,7 +6,10 @@ import {
getURLHostName, getURLHostName,
} from '../../helpers/utils/util'; } from '../../helpers/utils/util';
import { tokenInfoGetter } from '../../helpers/utils/token-util'; import { tokenInfoGetter } from '../../helpers/utils/token-util';
import { CONFIRM_IMPORT_TOKEN_ROUTE } from '../../helpers/constants/routes'; import {
CONFIRM_IMPORT_TOKEN_ROUTE,
EXPERIMENTAL_ROUTE,
} from '../../helpers/constants/routes';
import TextField from '../../components/ui/text-field'; import TextField from '../../components/ui/text-field';
import PageContainer from '../../components/ui/page-container'; import PageContainer from '../../components/ui/page-container';
import { Tabs, Tab } from '../../components/ui/tabs'; import { Tabs, Tab } from '../../components/ui/tabs';
@ -388,10 +391,27 @@ class ImportToken extends Component {
} }
renderSearchToken() { renderSearchToken() {
const { tokenList } = this.props; const { tokenList, history } = 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">
<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>,
])}
type={false}
withRightButton
useIcon
iconFillColor="#037DD6"
className="import-token__token-detection-announcement"
/>
<TokenSearch <TokenSearch
onSearch={({ results = [] }) => onSearch={({ results = [] }) =>
this.setState({ searchResults: results }) this.setState({ searchResults: results })

View File

@ -21,7 +21,7 @@
} }
&__search-token { &__search-token {
padding: 16px; padding: 0 16px 16px 16px;
} }
&__token-list { &__token-list {
@ -54,4 +54,8 @@
color: $primary-blue; color: $primary-blue;
padding-left: 0; padding-left: 0;
} }
&__token-detection-announcement {
margin-bottom: 16px;
}
} }