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:
parent
3c98be4214
commit
5aabe2ac75
@ -1009,6 +1009,9 @@
|
|||||||
"onlyConnectTrust": {
|
"onlyConnectTrust": {
|
||||||
"message": "Only connect with sites you trust."
|
"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": {
|
"optionalChainId": {
|
||||||
"message": "ChainID (optional)"
|
"message": "ChainID (optional)"
|
||||||
},
|
},
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
padding: 16px 0;
|
||||||
|
|
||||||
@media screen and (max-width: 575px) {
|
@media screen and (max-width: 575px) {
|
||||||
height: 69px;
|
height: 69px;
|
||||||
|
@ -82,6 +82,17 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 93%;
|
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 {
|
&__network-form-label {
|
||||||
|
@ -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 () {
|
render () {
|
||||||
const { t } = this.context
|
const { t } = this.context
|
||||||
const {
|
const {
|
||||||
@ -258,6 +267,7 @@ export default class NetworkForm extends PureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="networks-tab__network-form">
|
<div className="networks-tab__network-form">
|
||||||
|
{viewOnly ? null : this.renderWarning()}
|
||||||
{this.renderFormTextField(
|
{this.renderFormTextField(
|
||||||
'networkName',
|
'networkName',
|
||||||
'network-name',
|
'network-name',
|
||||||
@ -320,5 +330,4 @@ export default class NetworkForm extends PureComponent {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user