-
+ {process.env.MULTICHAIN ? null :
}
diff --git a/ui/pages/routes/routes.component.js b/ui/pages/routes/routes.component.js
index c5804d146..fae501142 100644
--- a/ui/pages/routes/routes.component.js
+++ b/ui/pages/routes/routes.component.js
@@ -31,6 +31,11 @@ import AccountMenu from '../../components/app/account-menu';
import { Modal } from '../../components/app/modals';
import Alert from '../../components/ui/alert';
import AppHeader from '../../components/app/app-header';
+import {
+ AppHeader as MultichainAppHeader,
+ AccountListMenu,
+ NetworkListMenu,
+} from '../../components/multichain';
import UnlockPage from '../unlock-page';
import Alerts from '../../components/app/alerts';
import Asset from '../asset';
@@ -90,7 +95,6 @@ import { SEND_STAGES } from '../../ducks/send';
import DeprecatedTestNetworks from '../../components/ui/deprecated-test-networks/deprecated-test-networks';
import NewNetworkInfo from '../../components/ui/new-network-info/new-network-info';
import { ThemeType } from '../../../shared/constants/preferences';
-import { AccountListMenu } from '../../components/multichain';
export default class Routes extends Component {
static propTypes = {
@@ -128,6 +132,8 @@ export default class Routes extends Component {
completedOnboarding: PropTypes.bool,
isAccountMenuOpen: PropTypes.bool,
toggleAccountMenu: PropTypes.func,
+ isNetworkMenuOpen: PropTypes.bool,
+ toggleNetworkMenu: PropTypes.func,
};
static contextTypes = {
@@ -436,6 +442,8 @@ export default class Routes extends Component {
completedOnboarding,
isAccountMenuOpen,
toggleAccountMenu,
+ isNetworkMenuOpen,
+ toggleNetworkMenu,
} = this.props;
const loadMessage =
loadingMessage || isNetworkLoading
@@ -478,24 +486,30 @@ export default class Routes extends Component {
- {!this.hideAppHeader() && (
-
- )}
+ {!this.hideAppHeader() &&
+ (process.env.MULTICHAIN ? (
+
+ ) : (
+
+ ))}
{this.showOnboardingHeader() &&
}
{completedOnboarding ?
: null}
{process.env.MULTICHAIN ? null :
}
{process.env.MULTICHAIN && isAccountMenuOpen ? (
toggleAccountMenu()} />
) : null}
+ {process.env.MULTICHAIN && isNetworkMenuOpen ? (
+ toggleNetworkMenu()} />
+ ) : null}
{isLoading ? : null}
{!isLoading && isNetworkLoading ? : null}
diff --git a/ui/pages/routes/routes.container.js b/ui/pages/routes/routes.container.js
index c132bcfa8..3f5c857ba 100644
--- a/ui/pages/routes/routes.container.js
+++ b/ui/pages/routes/routes.container.js
@@ -19,6 +19,7 @@ import {
setLastActiveTime,
setMouseUserState,
toggleAccountMenu,
+ toggleNetworkMenu,
} from '../../store/actions';
import { pageChanged } from '../../ducks/history/history';
import { prepareToLeaveSwaps } from '../../ducks/swaps/swaps';
@@ -57,6 +58,7 @@ function mapStateToProps(state) {
isCurrentProviderCustom: isCurrentProviderCustom(state),
completedOnboarding,
isAccountMenuOpen: state.metamask.isAccountMenuOpen,
+ isNetworkMenuOpen: state.metamask.isNetworkMenuOpen,
};
}
@@ -70,6 +72,7 @@ function mapDispatchToProps(dispatch) {
pageChanged: (path) => dispatch(pageChanged(path)),
prepareToLeaveSwaps: () => dispatch(prepareToLeaveSwaps()),
toggleAccountMenu: () => dispatch(toggleAccountMenu()),
+ toggleNetworkMenu: () => dispatch(toggleNetworkMenu()),
};
}
diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js
index 1b48a1e84..44d2b914d 100644
--- a/ui/selectors/selectors.js
+++ b/ui/selectors/selectors.js
@@ -1111,6 +1111,13 @@ export function getNetworkConfigurations(state) {
return state.metamask.networkConfigurations;
}
+export function getCurrentNetwork(state) {
+ const allNetworks = getAllNetworks(state);
+ const currentChainId = getCurrentChainId(state);
+
+ return allNetworks.find((network) => network.chainId === currentChainId);
+}
+
export function getAllNetworks(state) {
const networkConfigurations = getNetworkConfigurations(state) || {};
const showTestnetNetworks = getShowTestNetworks(state);
diff --git a/ui/store/actionConstants.ts b/ui/store/actionConstants.ts
index b58276ba9..34e1e9dfc 100644
--- a/ui/store/actionConstants.ts
+++ b/ui/store/actionConstants.ts
@@ -48,6 +48,7 @@ export const SHOW_LOADING = 'SHOW_LOADING_INDICATION';
export const HIDE_LOADING = 'HIDE_LOADING_INDICATION';
export const TOGGLE_ACCOUNT_MENU = 'TOGGLE_ACCOUNT_MENU';
+export const TOGGLE_NETWORK_MENU = 'TOGGLE_NETWORK_MENU';
// preferences
export const UPDATE_CUSTOM_NONCE = 'UPDATE_CUSTOM_NONCE';
diff --git a/ui/store/actions.ts b/ui/store/actions.ts
index 97be01ad5..fe47604c9 100644
--- a/ui/store/actions.ts
+++ b/ui/store/actions.ts
@@ -3122,6 +3122,12 @@ export function toggleAccountMenu() {
};
}
+export function toggleNetworkMenu() {
+ return {
+ type: actionConstants.TOGGLE_NETWORK_MENU,
+ };
+}
+
export function setParticipateInMetaMetrics(
participationPreference: boolean,
): ThunkAction<