Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Removing warning prop from settings #27990

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ exports[`Security Tab should match snapshot 1`] = `
</label>
</div>
</div>
<div
class="settings-tab__error"
>
warning
</div>
<span
class="settings-page__security-tab-sub-header__bold"
>
Expand Down
4 changes: 0 additions & 4 deletions ui/pages/settings/security-tab/security-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export default class SecurityTab extends PureComponent {
};

static propTypes = {
warning: PropTypes.string,
history: PropTypes.object,
openSeaEnabled: PropTypes.bool,
setOpenSeaEnabled: PropTypes.func,
Expand Down Expand Up @@ -1131,7 +1130,6 @@ export default class SecurityTab extends PureComponent {

render() {
const {
warning,
petnamesEnabled,
dataCollectionForMarketing,
setDataCollectionForMarketing,
Expand All @@ -1144,8 +1142,6 @@ export default class SecurityTab extends PureComponent {
{showDataCollectionDisclaimer
? this.renderDataCollectionWarning()
: null}

{warning && <div className="settings-tab__error">{warning}</div>}
<span className="settings-page__security-tab-sub-header__bold">
{this.context.t('security')}
</span>
Expand Down
6 changes: 1 addition & 5 deletions ui/pages/settings/security-tab/security-tab.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ import { openBasicFunctionalityModal } from '../../../ducks/app/app';
import SecurityTab from './security-tab.component';

const mapStateToProps = (state) => {
const {
appState: { warning },
metamask,
} = state;
const { metamask } = state;

const petnamesEnabled = getPetnamesEnabled(state);

Expand All @@ -60,7 +57,6 @@ const mapStateToProps = (state) => {
const networkConfigurations = getNetworkConfigurationsByChainId(state);

return {
warning,
incomingTransactionsPreferences,
networkConfigurations,
participateInMetaMetrics,
Expand Down
2 changes: 0 additions & 2 deletions ui/pages/settings/security-tab/security-tab.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ jest.mock('../../../ducks/app/app.ts', () => {
});

describe('Security Tab', () => {
mockState.appState.warning = 'warning'; // This tests an otherwise untested render branch

const mockStore = configureMockStore([thunk])(mockState);

function toggleCheckbox(testId, initialState, skipRender = false) {
Expand Down
4 changes: 0 additions & 4 deletions ui/pages/settings/settings-tab/settings-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export default class SettingsTab extends PureComponent {
static propTypes = {
setUseBlockie: PropTypes.func,
setCurrentCurrency: PropTypes.func,
warning: PropTypes.string,
updateCurrentLocale: PropTypes.func,
currentLocale: PropTypes.string,
useBlockie: PropTypes.bool,
Expand Down Expand Up @@ -429,11 +428,8 @@ export default class SettingsTab extends PureComponent {
}

render() {
const { warning } = this.props;

return (
<div className="settings-page__body">
{warning ? <div className="settings-tab__error">{warning}</div> : null}
{this.renderCurrentConversion()}
{this.renderShowNativeTokenAsMainBalance()}
{this.renderCurrentLocale()}
Expand Down
6 changes: 1 addition & 5 deletions ui/pages/settings/settings-tab/settings-tab.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ import { getProviderConfig } from '../../../ducks/metamask/metamask';
import SettingsTab from './settings-tab.component';

const mapStateToProps = (state) => {
const {
appState: { warning },
metamask,
} = state;
const { metamask } = state;
const { currentCurrency, useBlockie, currentLocale } = metamask;
const { ticker: nativeCurrency } = getProviderConfig(state);
const { address: selectedAddress } = getSelectedInternalAccount(state);
Expand All @@ -31,7 +28,6 @@ const mapStateToProps = (state) => {
const tokenList = getTokenList(state);

return {
warning,
currentLocale,
currentCurrency,
nativeCurrency,
Expand Down
Loading