mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove bottom space when hiding testnet (#12821)
This commit is contained in:
parent
fc185e3139
commit
b9093e2a4d
@ -3,7 +3,6 @@ import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { compose } from 'redux';
|
||||
import classnames from 'classnames';
|
||||
import Button from '../../ui/button';
|
||||
import * as actions from '../../../store/actions';
|
||||
import { openAlert as displayInvalidCustomNetworkAlert } from '../../../ducks/alerts/invalid-custom-network';
|
||||
@ -362,21 +361,19 @@ class NetworkDropdown extends Component {
|
||||
this.props.provider,
|
||||
)}
|
||||
|
||||
<div
|
||||
className={classnames('network-dropdown-testnets', {
|
||||
'network-dropdown-testnets--no-visibility': !shouldShowTestNetworks,
|
||||
})}
|
||||
>
|
||||
{this.renderNetworkEntry('ropsten')}
|
||||
{this.renderNetworkEntry('kovan')}
|
||||
{this.renderNetworkEntry('rinkeby')}
|
||||
{this.renderNetworkEntry('goerli')}
|
||||
{this.renderCustomRpcList(
|
||||
rpcListDetailForLocalHost,
|
||||
this.props.provider,
|
||||
{ isLocalHost: true },
|
||||
)}
|
||||
</div>
|
||||
{shouldShowTestNetworks && (
|
||||
<>
|
||||
{this.renderNetworkEntry('ropsten')}
|
||||
{this.renderNetworkEntry('kovan')}
|
||||
{this.renderNetworkEntry('rinkeby')}
|
||||
{this.renderNetworkEntry('goerli')}
|
||||
{this.renderCustomRpcList(
|
||||
rpcListDetailForLocalHost,
|
||||
this.props.provider,
|
||||
{ isLocalHost: true },
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{this.renderAddCustomButton()}
|
||||
|
@ -147,6 +147,10 @@ describe('Network Dropdown', () => {
|
||||
'addNetwork',
|
||||
);
|
||||
});
|
||||
|
||||
it('shows test networks in the dropdown', () => {
|
||||
expect(wrapper.find('.network-dropdown-list li')).toHaveLength(8);
|
||||
});
|
||||
});
|
||||
|
||||
describe('NetworkDropdown in appState is true and show test networks is false', () => {
|
||||
@ -193,5 +197,9 @@ describe('Network Dropdown', () => {
|
||||
'addNetwork',
|
||||
);
|
||||
});
|
||||
|
||||
it('does not show test networks in the dropdown', () => {
|
||||
expect(wrapper.find('.network-dropdown-list li')).toHaveLength(3);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -141,12 +141,6 @@
|
||||
background-color: $scorpion;
|
||||
}
|
||||
|
||||
.network-dropdown-testnets {
|
||||
&--no-visibility {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.network-dropdown-title {
|
||||
@include H4;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user