1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

remove delete action in networks dropdown list

This commit is contained in:
Matthias Kretschmann 2023-03-16 13:57:16 +00:00
parent 24d5487cbb
commit 8054da5d4e
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 4 additions and 26 deletions

View File

@ -30,9 +30,9 @@ import {
} from '../../../helpers/constants/routes';
import {
Icon,
ButtonIcon,
// ButtonIcon,
ICON_NAMES,
ICON_SIZES,
// ICON_SIZES,
} from '../../component-library';
import { Dropdown, DropdownMenuItem } from './dropdown';
@ -109,7 +109,7 @@ class NetworkDropdown extends Component {
shouldShowTestNetworks: PropTypes.bool,
networkDropdownOpen: PropTypes.bool.isRequired,
displayInvalidCustomNetworkAlert: PropTypes.func.isRequired,
showConfirmDeleteNetworkModal: PropTypes.func.isRequired,
// showConfirmDeleteNetworkModal: PropTypes.func.isRequired,
showTestnetMessageInDropdown: PropTypes.bool.isRequired,
hideTestNetMessage: PropTypes.func.isRequired,
history: PropTypes.object,
@ -165,7 +165,7 @@ class NetworkDropdown extends Component {
renderCustomRpcList(networkConfigurations, provider, opts = {}) {
return Object.entries(networkConfigurations).map(
([networkConfigurationId, networkConfiguration]) => {
const { rpcUrl, chainId, nickname = '', id } = networkConfiguration;
const { rpcUrl, chainId, nickname = '' } = networkConfiguration;
const isCurrentRpcTarget =
provider.type === NETWORK_TYPES.RPC && rpcUrl === provider.rpcUrl;
return (
@ -206,21 +206,6 @@ class NetworkDropdown extends Component {
>
{nickname || rpcUrl}
</span>
{isCurrentRpcTarget ? null : (
<ButtonIcon
className="delete"
iconName={ICON_NAMES.CLOSE}
size={ICON_SIZES.SM}
ariaLabel={this.context.t('delete')}
onClick={(e) => {
e.stopPropagation();
this.props.showConfirmDeleteNetworkModal({
target: id,
onConfirm: () => undefined,
});
}}
/>
)}
</DropdownMenuItem>
);
},

View File

@ -129,13 +129,6 @@
border-bottom: 1px solid var(--color-border-muted);
}
.network-dropdown-divider {
width: 100%;
height: 1px;
margin: 10px 0;
background-color: var(--color-border-default);
}
.network-dropdown-title {
@include H5;