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

Warn users to only add custom networks that they trust (#8789)

* add warning when adding custom network

* give the settings subheader breathing space
This commit is contained in:
Erik Marks 2020-06-12 11:21:29 -07:00 committed by GitHub
parent 3c98be4214
commit 5aabe2ac75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 1 deletions

View File

@ -1009,6 +1009,9 @@
"onlyConnectTrust": {
"message": "Only connect with sites you trust."
},
"onlyAddTrustedNetworks": {
"message": "A malicious Ethereum network provider can lie about the state of the blockchain and record your network activity. Only add custom networks you trust."
},
"optionalChainId": {
"message": "ChainID (optional)"
},

View File

@ -63,6 +63,7 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 0;
@media screen and (max-width: 575px) {
height: 69px;

View File

@ -82,6 +82,17 @@
flex-direction: column;
width: 93%;
}
&--warning {
background-color: #FEFAE8;
border: 1px solid #FFD33D;
width: 93%;
border-radius: 5px;
box-sizing: border-box;
padding: 12px;
margin: 12px 0;
font-size: 12px;
}
}
&__network-form-label {

View File

@ -237,6 +237,15 @@ export default class NetworkForm extends PureComponent {
}
}
renderWarning () {
const { t } = this.context
return (
<div className="networks-tab__network-form-row--warning">
{t('onlyAddTrustedNetworks')}
</div>
)
}
render () {
const { t } = this.context
const {
@ -258,6 +267,7 @@ export default class NetworkForm extends PureComponent {
return (
<div className="networks-tab__network-form">
{viewOnly ? null : this.renderWarning()}
{this.renderFormTextField(
'networkName',
'network-name',
@ -320,5 +330,4 @@ export default class NetworkForm extends PureComponent {
</div>
)
}
}