mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
remove delete action in networks dropdown list
This commit is contained in:
parent
24d5487cbb
commit
8054da5d4e
@ -30,9 +30,9 @@ import {
|
|||||||
} from '../../../helpers/constants/routes';
|
} from '../../../helpers/constants/routes';
|
||||||
import {
|
import {
|
||||||
Icon,
|
Icon,
|
||||||
ButtonIcon,
|
// ButtonIcon,
|
||||||
ICON_NAMES,
|
ICON_NAMES,
|
||||||
ICON_SIZES,
|
// ICON_SIZES,
|
||||||
} from '../../component-library';
|
} from '../../component-library';
|
||||||
import { Dropdown, DropdownMenuItem } from './dropdown';
|
import { Dropdown, DropdownMenuItem } from './dropdown';
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ class NetworkDropdown extends Component {
|
|||||||
shouldShowTestNetworks: PropTypes.bool,
|
shouldShowTestNetworks: PropTypes.bool,
|
||||||
networkDropdownOpen: PropTypes.bool.isRequired,
|
networkDropdownOpen: PropTypes.bool.isRequired,
|
||||||
displayInvalidCustomNetworkAlert: PropTypes.func.isRequired,
|
displayInvalidCustomNetworkAlert: PropTypes.func.isRequired,
|
||||||
showConfirmDeleteNetworkModal: PropTypes.func.isRequired,
|
// showConfirmDeleteNetworkModal: PropTypes.func.isRequired,
|
||||||
showTestnetMessageInDropdown: PropTypes.bool.isRequired,
|
showTestnetMessageInDropdown: PropTypes.bool.isRequired,
|
||||||
hideTestNetMessage: PropTypes.func.isRequired,
|
hideTestNetMessage: PropTypes.func.isRequired,
|
||||||
history: PropTypes.object,
|
history: PropTypes.object,
|
||||||
@ -165,7 +165,7 @@ class NetworkDropdown extends Component {
|
|||||||
renderCustomRpcList(networkConfigurations, provider, opts = {}) {
|
renderCustomRpcList(networkConfigurations, provider, opts = {}) {
|
||||||
return Object.entries(networkConfigurations).map(
|
return Object.entries(networkConfigurations).map(
|
||||||
([networkConfigurationId, networkConfiguration]) => {
|
([networkConfigurationId, networkConfiguration]) => {
|
||||||
const { rpcUrl, chainId, nickname = '', id } = networkConfiguration;
|
const { rpcUrl, chainId, nickname = '' } = networkConfiguration;
|
||||||
const isCurrentRpcTarget =
|
const isCurrentRpcTarget =
|
||||||
provider.type === NETWORK_TYPES.RPC && rpcUrl === provider.rpcUrl;
|
provider.type === NETWORK_TYPES.RPC && rpcUrl === provider.rpcUrl;
|
||||||
return (
|
return (
|
||||||
@ -206,21 +206,6 @@ class NetworkDropdown extends Component {
|
|||||||
>
|
>
|
||||||
{nickname || rpcUrl}
|
{nickname || rpcUrl}
|
||||||
</span>
|
</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>
|
</DropdownMenuItem>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -129,13 +129,6 @@
|
|||||||
border-bottom: 1px solid var(--color-border-muted);
|
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 {
|
.network-dropdown-title {
|
||||||
@include H5;
|
@include H5;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user