Skip to content

Commit 667e58a

Browse files
committed
fix: add enabled network section
1 parent 2ef606a commit 667e58a

File tree

4 files changed

+17
-26
lines changed

4 files changed

+17
-26
lines changed

app/_locales/en/messages.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/components/multichain/network-list-item-menu/network-list-item-menu.js

+2-25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef } from 'react';
1+
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { useI18nContext } from '../../../hooks/useI18nContext';
44
import {
@@ -21,29 +21,6 @@ export const NetworkListItemMenu = ({
2121
}) => {
2222
const t = useI18nContext();
2323

24-
// Handle Tab key press for accessibility inside the popover and will close the popover on the last MenuItem
25-
const lastItemRef = useRef(null);
26-
const accountDetailsItemRef = useRef(null);
27-
const removeAccountItemRef = useRef(null);
28-
const removeJWTItemRef = useRef(null);
29-
30-
// Checks the MenuItems from the bottom to top to set lastItemRef on the last MenuItem that is not disabled
31-
useEffect(() => {
32-
if (removeAccountItemRef.current) {
33-
lastItemRef.current = removeAccountItemRef.current;
34-
} else {
35-
lastItemRef.current = accountDetailsItemRef.current;
36-
}
37-
// eslint-disable-next-line react-hooks/exhaustive-deps
38-
}, [
39-
removeJWTItemRef.current,
40-
removeAccountItemRef.current,
41-
accountDetailsItemRef.current,
42-
]);
43-
44-
// Handle click outside of the popover to close it
45-
const popoverDialogRef = useRef(null);
46-
4724
return (
4825
<Popover
4926
className="multichain-network-list-item-menu__popover"
@@ -59,7 +36,7 @@ export const NetworkListItemMenu = ({
5936
flip
6037
>
6138
<ModalFocus restoreFocus initialFocusRef={anchorElement}>
62-
<div ref={popoverDialogRef}>
39+
<div>
6340
{onEditClick ? (
6441
<MenuItem
6542
iconName={IconName.Edit}

ui/components/multichain/network-list-menu/network-list-menu.js

+9
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,15 @@ export const NetworkListMenu = ({ onClose }) => {
358358
/>
359359
) : null}
360360
<Box className="multichain-network-list-menu">
361+
<Box
362+
paddingRight={4}
363+
paddingLeft={4}
364+
paddingBottom={4}
365+
display={Display.Flex}
366+
justifyContent={JustifyContent.spaceBetween}
367+
>
368+
<Text> {t('enabledNetworks')}</Text>
369+
</Box>
361370
{searchResults.length === 0 && focusSearch ? (
362371
<Text
363372
paddingLeft={4}

ui/pages/settings/networks-tab/networks-form/networks-form.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ const NetworksForm = ({
591591
warningMessage = t('failedToFetchTickerSymbolData');
592592
} else if (
593593
!matchedNames.some(
594-
(name) => name.toLowerCase() === formName.toLowerCase(),
594+
(name) => name?.toLowerCase() === formName.toLowerCase(),
595595
)
596596
) {
597597
warningKey = 'wrongNetworkName';
@@ -671,12 +671,14 @@ const NetworksForm = ({
671671
const nameWarning = await validateNetworkName(chainId, networkName);
672672
const blockExplorerError = validateBlockExplorerURL(blockExplorerUrl);
673673
const rpcUrlError = validateRPCUrl(rpcUrl);
674+
674675
setErrors({
675676
...errors,
676677
blockExplorerUrl: blockExplorerError,
677678
rpcUrl: rpcUrlError,
678679
chainId: chainIdError,
679680
});
681+
680682
setWarnings({
681683
...warnings,
682684
chainId: chainIdWarning,

0 commit comments

Comments
 (0)