mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Opening Network Forms in full screen from the popup view (#15442)
This commit is contained in:
parent
3b30984ce5
commit
97b10f96e0
@ -2,7 +2,6 @@ import React, { useEffect, useRef } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { useHistory } from 'react-router-dom';
|
|
||||||
import { useI18nContext } from '../../../../hooks/useI18nContext';
|
import { useI18nContext } from '../../../../hooks/useI18nContext';
|
||||||
import {
|
import {
|
||||||
NETWORK_TYPE_RPC,
|
NETWORK_TYPE_RPC,
|
||||||
@ -10,7 +9,7 @@ import {
|
|||||||
} from '../../../../../shared/constants/network';
|
} from '../../../../../shared/constants/network';
|
||||||
import LockIcon from '../../../../components/ui/lock-icon';
|
import LockIcon from '../../../../components/ui/lock-icon';
|
||||||
import IconCheck from '../../../../components/ui/icon/icon-check';
|
import IconCheck from '../../../../components/ui/icon/icon-check';
|
||||||
import { NETWORKS_FORM_ROUTE } from '../../../../helpers/constants/routes';
|
import { NETWORKS_ROUTE } from '../../../../helpers/constants/routes';
|
||||||
import { setSelectedSettingsRpcUrl } from '../../../../store/actions';
|
import { setSelectedSettingsRpcUrl } from '../../../../store/actions';
|
||||||
import { getEnvironmentType } from '../../../../../app/scripts/lib/util';
|
import { getEnvironmentType } from '../../../../../app/scripts/lib/util';
|
||||||
import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../shared/constants/app';
|
import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../shared/constants/app';
|
||||||
@ -28,7 +27,6 @@ const NetworksListItem = ({
|
|||||||
setSearchedNetworks,
|
setSearchedNetworks,
|
||||||
}) => {
|
}) => {
|
||||||
const t = useI18nContext();
|
const t = useI18nContext();
|
||||||
const history = useHistory();
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const environmentType = getEnvironmentType();
|
const environmentType = getEnvironmentType();
|
||||||
const isFullScreen = environmentType === ENVIRONMENT_TYPE_FULLSCREEN;
|
const isFullScreen = environmentType === ENVIRONMENT_TYPE_FULLSCREEN;
|
||||||
@ -68,7 +66,7 @@ const NetworksListItem = ({
|
|||||||
setSearchedNetworks([]);
|
setSearchedNetworks([]);
|
||||||
dispatch(setSelectedSettingsRpcUrl(rpcUrl));
|
dispatch(setSelectedSettingsRpcUrl(rpcUrl));
|
||||||
if (!isFullScreen) {
|
if (!isFullScreen) {
|
||||||
history.push(NETWORKS_FORM_ROUTE);
|
global.platform.openExtensionInBrowser(NETWORKS_ROUTE);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user