From 2e69f3233e1891d3633261bfcbe383d862855ed1 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 3 Dec 2019 13:05:44 -0330 Subject: [PATCH] eslint: Enable more react/jsx-* rules (#7592) --- .eslintrc | 19 +++ development/mock-dev.js | 2 +- .../account-menu/account-menu.component.js | 16 +-- .../app/app-header/app-header.component.js | 3 +- ...onfirm-page-container-summary.component.js | 8 +- ...confirm-page-container-header.component.js | 54 ++++---- ...irm-page-container-navigation.component.js | 24 ++-- .../confirm-page-container.component.js | 20 +-- .../recipient-group.component.js | 8 +- .../components/network-dropdown-icon.js | 14 ++- .../app/dropdowns/tests/menu.test.js | 10 +- .../dropdowns/tests/network-dropdown.test.js | 2 +- .../advanced-gas-inputs.component.js | 22 ++-- .../advanced-tab-content.component.js | 22 ++-- .../advanced-tab-content-component.test.js | 26 ++-- .../basic-tab-content.component.js | 12 +- .../tests/basic-tab-content-component.test.js | 8 +- .../gas-modal-page-container.component.js | 15 +-- ...gas-modal-page-container-component.test.js | 84 +++++++------ .../gas-price-button-group.component.js | 34 ++--- .../gas-price-button-group-component.test.js | 8 +- .../gas-slider/gas-slider.component.js | 2 +- ui/app/components/app/input-number.js | 3 +- .../loading-network-screen.component.js | 62 +++++----- .../account-details-modal.component.js | 18 +-- .../confirm-remove-account.component.js | 4 +- .../deposit-ether-modal.component.js | 3 +- .../edit-approval-permission.component.js | 40 +++--- .../export-private-key-modal.component.js | 2 +- .../metametrics-opt-in-modal.component.js | 3 +- .../multiple-notifications.component.js | 10 +- .../network-display.component.js | 32 ++--- ...ovider-page-container-content.component.js | 2 +- .../tests/selected-account-component.test.js | 10 +- .../app/sidebars/sidebar.component.js | 16 +-- .../sidebars/tests/sidebars-component.test.js | 14 ++- .../signature-request-original.component.js | 50 ++++---- .../signature-request-header.component.js | 10 +- .../tests/signature-request.test.js | 15 ++- .../app/token-cell/token-cell.component.js | 3 +- ui/app/components/app/token-list.js | 12 +- .../transaction-action.component.test.js | 12 +- .../transaction-breakdown.component.js | 26 ++-- ...transaction-list-item-details.component.js | 20 +-- .../transaction-list-item.component.js | 18 +-- .../token-view-balance.component.test.js | 38 +++--- .../app/wallet-view/wallet-view.component.js | 8 +- .../ui/button-group/button-group.stories.js | 8 +- .../tests/button-group-component.test.js | 16 ++- ui/app/components/ui/button/button.stories.js | 28 ++--- .../tests/currency-display.component.test.js | 22 ++-- .../ui/eth-balance/eth-balance.component.js | 44 ++++--- .../tests/hex-to-decimal.component.test.js | 20 +-- .../tests/identicon.component.test.js | 2 +- .../page-container-footer.component.js | 18 +-- .../page-container-footer.component.test.js | 18 +-- .../page-container-header.component.js | 26 ++-- .../page-container-header.component.test.js | 20 +-- .../sender-to-recipient.component.js | 4 +- .../ui/text-field/text-field.stories.js | 28 ++--- .../token-list/token-list.component.js | 3 +- .../confirm-approve-content.component.js | 57 +++++---- .../confirm-approve.component.js | 40 +++--- .../confirm-transaction-base.component.js | 68 +++++----- .../connect-hardware/connect-screen.js | 3 +- .../create-account.component.js | 18 +-- .../create-account/import-account/index.js | 3 +- .../create-account/new-account.component.js | 11 +- .../import-with-seed-phrase.component.js | 3 +- .../new-account/new-account.component.js | 3 +- .../end-of-flow/end-of-flow.component.js | 9 +- .../metametrics-opt-in.component.js | 3 +- .../reveal-seed-phrase.component.js | 21 ++-- ui/app/pages/home/home.component.js | 90 +++++++------- .../account-list-item.component.js | 72 ++++++----- .../tests/account-list-item-component.test.js | 24 ++-- .../add-recipient/add-recipient.component.js | 2 +- .../tests/add-recipient-component.test.js | 36 +++--- .../tests/amount-max-button-component.test.js | 20 +-- .../tests/send-amount-row-component.test.js | 36 +++--- .../send-asset-row.component.js | 3 +- .../send-dropdown-list.component.js | 40 +++--- .../send-dropdown-list-component.test.js | 24 ++-- .../gas-fee-display.component.js | 16 ++- .../test/gas-fee-display.component.test.js | 18 +-- .../send-gas-row/send-gas-row.component.js | 117 ++++++++++-------- .../tests/send-gas-row-component.test.js | 30 ++--- .../send-row-error-message-component.test.js | 10 +- .../tests/send-row-wrapper-component.test.js | 52 ++++---- .../tests/send-footer-component.test.js | 90 +++++++------- .../tests/send-header-component.test.js | 12 +- .../pages/send/tests/send-component.test.js | 56 +++++---- .../add-contact/add-contact.component.js | 12 +- .../contact-list-tab.component.js | 49 +++++--- .../edit-contact/edit-contact.component.js | 2 +- .../networks-tab/networks-tab.component.js | 34 ++--- ui/app/pages/settings/settings.component.js | 20 +-- 97 files changed, 1243 insertions(+), 962 deletions(-) diff --git a/.eslintrc b/.eslintrc index f77127da8..74b30dcbe 100644 --- a/.eslintrc +++ b/.eslintrc @@ -156,6 +156,25 @@ "react/jsx-equals-spacing": 2, "react/no-deprecated": 0, "react/default-props-match-prop-types": 2, + "react/jsx-closing-tag-location": 2, + "react/jsx-no-duplicate-props": 2, + "react/jsx-closing-bracket-location": 2, + "react/jsx-first-prop-new-line": 2, + "react/jsx-max-props-per-line": [2, { "maximum": 1, "when": "multiline"} ], + "react/jsx-tag-spacing": [2, { + "closingSlash": "never", + "beforeSelfClosing": "always", + "afterOpening": "never" + }], + "react/jsx-wrap-multilines": [2, { + "declaration": "parens-new-line", + "assignment": "parens-new-line", + "return": "parens-new-line", + "arrow": "parens-new-line", + "condition": "parens-new-line", + "logical": "parens-new-line", + "prop": "parens-new-line" + }], "semi": [2, "never"], "semi-spacing": [2, { "before": false, "after": true }], "space-before-blocks": [2, "always"], diff --git a/development/mock-dev.js b/development/mock-dev.js index 16fdd0273..51a8cde46 100644 --- a/development/mock-dev.js +++ b/development/mock-dev.js @@ -135,7 +135,7 @@ function startApp () { margin: '20px', }} > - + , container, diff --git a/ui/app/components/app/account-menu/account-menu.component.js b/ui/app/components/app/account-menu/account-menu.component.js index 7be2bc5dd..c13163a81 100644 --- a/ui/app/components/app/account-menu/account-menu.component.js +++ b/ui/app/components/app/account-menu/account-menu.component.js @@ -253,12 +253,12 @@ export default class AccountMenu extends PureComponent { }) history.push(NEW_ACCOUNT_ROUTE) }} - icon={ + icon={( - } + )} text={t('createAccount')} /> - } + )} text={t('importAccount')} /> - } + )} text={t('connectHardwareWallet')} /> @@ -328,12 +328,12 @@ export default class AccountMenu extends PureComponent { }, }) }} - icon={ + icon={( - } + )} text={t('settings')} /> diff --git a/ui/app/components/app/app-header/app-header.component.js b/ui/app/components/app/app-header/app-header.component.js index e1bc0cf24..bd01558c5 100644 --- a/ui/app/components/app/app-header/app-header.component.js +++ b/ui/app/components/app/app-header/app-header.component.js @@ -89,7 +89,8 @@ export default class AppHeader extends PureComponent { return (
+ className={classnames('app-header', { 'app-header--back-drop': isUnlocked })} + >
{
{ - hideSubtitle ||
- { subtitleComponent || subtitle } -
+ hideSubtitle || ( +
+ { subtitleComponent || subtitle } +
+ ) } ) diff --git a/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js b/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js index 898d59068..4b91b4ddb 100644 --- a/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js +++ b/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js @@ -34,36 +34,40 @@ export default class ConfirmPageContainerHeader extends Component { return (
{ !showAccountInHeader - ?
- - onEdit()} + ? ( +
- { this.context.t('edit') } - -
+ + onEdit()} + > + { this.context.t('edit') } + +
+ ) : null } { showAccountInHeader - ?
-
- + ? ( +
+
+ +
+
+ { addressSlicer(accountAddress) } +
-
- { addressSlicer(accountAddress) } -
-
+ ) : null } { !isFullScreen && } diff --git a/ui/app/components/app/confirm-page-container/confirm-page-container-navigation/confirm-page-container-navigation.component.js b/ui/app/components/app/confirm-page-container/confirm-page-container-navigation/confirm-page-container-navigation.component.js index c24d24b17..dd1fd2da4 100755 --- a/ui/app/components/app/confirm-page-container/confirm-page-container-navigation/confirm-page-container-navigation.component.js +++ b/ui/app/components/app/confirm-page-container/confirm-page-container-navigation/confirm-page-container-navigation.component.js @@ -5,23 +5,28 @@ const ConfirmPageContainerNavigation = props => { const { onNextTx, totalTx, positionOfCurrentTx, nextTxId, prevTxId, showNavigation, firstTx, lastTx, ofText, requestsWaitingText } = props return ( -
-
+ }} + >
onNextTx(firstTx)}> + onClick={() => onNextTx(firstTx)} + >
onNextTx(prevTxId)}> + onClick={() => onNextTx(prevTxId)} + >
@@ -37,15 +42,18 @@ const ConfirmPageContainerNavigation = props => { className="confirm-page-container-navigation__container" style={{ visibility: nextTxId ? 'initial' : 'hidden', - }}> + }} + >
onNextTx(nextTxId)}> + onClick={() => onNextTx(nextTxId)} + >
onNextTx(lastTx)}> + onClick={() => onNextTx(lastTx)} + >
diff --git a/ui/app/components/app/confirm-page-container/confirm-page-container.component.js b/ui/app/components/app/confirm-page-container/confirm-page-container.component.js index 86ce2bff7..9ebae3d95 100644 --- a/ui/app/components/app/confirm-page-container/confirm-page-container.component.js +++ b/ui/app/components/app/confirm-page-container/confirm-page-container.component.js @@ -133,15 +133,17 @@ export default class ConfirmPageContainer extends Component { > { hideSenderToRecipient ? null - : + : ( + + ) } { diff --git a/ui/app/components/app/contact-list/recipient-group/recipient-group.component.js b/ui/app/components/app/contact-list/recipient-group/recipient-group.component.js index a2248326e..20e2b3494 100644 --- a/ui/app/components/app/contact-list/recipient-group/recipient-group.component.js +++ b/ui/app/components/app/contact-list/recipient-group/recipient-group.component.js @@ -15,9 +15,11 @@ export default function RecipientGroup ({ label, items, onSelect, selectedAddres return (
- {label &&
- {label} -
} + {label && ( +
+ {label} +
+ )} { items.map(({ address, name }) => (
-
+
) } diff --git a/ui/app/components/app/dropdowns/tests/menu.test.js b/ui/app/components/app/dropdowns/tests/menu.test.js index 56cec93a3..b3bc34fa9 100644 --- a/ui/app/components/app/dropdowns/tests/menu.test.js +++ b/ui/app/components/app/dropdowns/tests/menu.test.js @@ -11,7 +11,7 @@ describe('Dropdown Menu Components', () => { beforeEach(() => { wrapper = shallow( - + ) }) @@ -73,9 +73,11 @@ describe('Dropdown Menu Components', () => { const onClickSpy = sinon.spy() beforeEach(() => { - wrapper = shallow() + wrapper = shallow(( + + )) }) it('simulates click', () => { diff --git a/ui/app/components/app/dropdowns/tests/network-dropdown.test.js b/ui/app/components/app/dropdowns/tests/network-dropdown.test.js index 4a81b973f..98cba1d2e 100644 --- a/ui/app/components/app/dropdowns/tests/network-dropdown.test.js +++ b/ui/app/components/app/dropdowns/tests/network-dropdown.test.js @@ -57,7 +57,7 @@ describe('Network Dropdown', () => { beforeEach(() => { wrapper = mountWithRouter( - , + , ) }) diff --git a/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js b/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js index 7fb5aa6f4..b881db6e5 100644 --- a/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js +++ b/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js @@ -119,10 +119,12 @@ export default class AdvancedGasInputs extends Component { value={value} onChange={onChange} /> -
+
onChange({ target: { value: value + 1 } })} @@ -159,21 +161,21 @@ export default class AdvancedGasInputs extends Component { errorText: gasPriceErrorText, errorType: gasPriceErrorType, } = this.gasPriceError({ insufficientBalance, customPriceIsSafe, isSpeedUp, gasPrice }) - const gasPriceErrorComponent = gasPriceErrorType ? + const gasPriceErrorComponent = gasPriceErrorType ? (
{ gasPriceErrorText } -
: - null +
+ ) : null const { errorText: gasLimitErrorText, errorType: gasLimitErrorType, } = this.gasLimitError({ insufficientBalance, gasLimit }) - const gasLimitErrorComponent = gasLimitErrorType ? + const gasLimitErrorComponent = gasLimitErrorType ? (
{ gasLimitErrorText } -
: - null +
+ ) : null return (
diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js index 306dd03a0..19e3aa776 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js @@ -83,17 +83,19 @@ export default class AdvancedTabContent extends Component { />
{ isEthereumNetwork - ?
-
{ t('liveGasPricePredictions') }
- {!gasEstimatesLoading - ? - : - } -
- { t('slower') } - { t('faster') } + ? ( +
+
{ t('liveGasPricePredictions') }
+ {!gasEstimatesLoading + ? + : + } +
+ { t('slower') } + { t('faster') } +
-
+ ) :
{ t('chartOnlyAvailableEth') }
}
diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js index 05075f3ba..16b15df41 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js @@ -18,18 +18,20 @@ describe('AdvancedTabContent Component', function () { let wrapper beforeEach(() => { - wrapper = shallow() + wrapper = shallow(( + + )) }) afterEach(() => { diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js b/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js index c804abe3a..94d22ee4a 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js @@ -21,11 +21,13 @@ export default class BasicTabContent extends Component {
{ t('estimatedProcessingTimes') }
{ t('selectAHigherGasFee') }
{!gasPriceButtonGroupProps.loading - ? + ? ( + + ) : }
{ t('acceleratingATransaction') }
diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js index 0989ac677..80fbffe05 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js @@ -38,9 +38,11 @@ describe('BasicTabContent Component', function () { let wrapper beforeEach(() => { - wrapper = shallow() + wrapper = shallow(( + + )) }) describe('render', () => { diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js index f405cb7b9..daf91eae3 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js @@ -160,13 +160,14 @@ export default class GasModalPageContainer extends Component { return ( - {tabsToRender.map(({ name, content }, i) => -
- { content } - { this.renderInfoRows(newTotalFiat, newTotalEth, sendAmount, transactionFee) } -
-
- )} + {tabsToRender.map(({ name, content }, i) => ( + +
+ { content } + { this.renderInfoRows(newTotalFiat, newTotalEth, sendAmount, transactionFee) } +
+
+ ))}
) } diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js index 3e416db49..50efb46f0 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js @@ -63,23 +63,25 @@ describe('GasModalPageContainer Component', function () { let wrapper beforeEach(() => { - wrapper = shallow( 'mockupdateCustomGasPrice'} - updateCustomGasLimit={() => 'mockupdateCustomGasLimit'} - customGasPrice={21} - customGasLimit={54321} - gasPriceButtonGroupProps={mockGasPriceButtonGroupProps} - infoRowProps={mockInfoRowProps} - currentTimeEstimate="1 min 31 sec" - customGasPriceInHex="mockCustomGasPriceInHex" - customGasLimitInHex="mockCustomGasLimitInHex" - insufficientBalance={false} - disableSave={false} - />) + wrapper = shallow(( + 'mockupdateCustomGasPrice'} + updateCustomGasLimit={() => 'mockupdateCustomGasLimit'} + customGasPrice={21} + customGasLimit={54321} + gasPriceButtonGroupProps={mockGasPriceButtonGroupProps} + infoRowProps={mockInfoRowProps} + currentTimeEstimate="1 min 31 sec" + customGasPriceInHex="mockCustomGasPriceInHex" + customGasLimitInHex="mockCustomGasLimitInHex" + insufficientBalance={false} + disableSave={false} + /> + )) }) afterEach(() => { @@ -134,10 +136,12 @@ describe('GasModalPageContainer Component', function () { it('should pass the correct renderTabs property to PageContainer', () => { sinon.stub(GP, 'renderTabs').returns('mockTabs') - const renderTabsWrapperTester = shallow(, { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }) + const renderTabsWrapperTester = shallow(( + + ), { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }) const { tabsComponent } = renderTabsWrapperTester.find(PageContainer).props() assert.equal(tabsComponent, 'mockTabs') GasModalPageContainer.prototype.renderTabs.restore() @@ -184,24 +188,26 @@ describe('GasModalPageContainer Component', function () { }) it('should not render the basic tab if hideBasic is true', () => { - wrapper = shallow( 'mockupdateCustomGasPrice'} - updateCustomGasLimit={() => 'mockupdateCustomGasLimit'} - customGasPrice={21} - customGasLimit={54321} - gasPriceButtonGroupProps={mockGasPriceButtonGroupProps} - infoRowProps={mockInfoRowProps} - currentTimeEstimate="1 min 31 sec" - customGasPriceInHex="mockCustomGasPriceInHex" - customGasLimitInHex="mockCustomGasLimitInHex" - insufficientBalance={false} - disableSave={false} - hideBasic - />) + wrapper = shallow(( + 'mockupdateCustomGasPrice'} + updateCustomGasLimit={() => 'mockupdateCustomGasLimit'} + customGasPrice={21} + customGasLimit={54321} + gasPriceButtonGroupProps={mockGasPriceButtonGroupProps} + infoRowProps={mockInfoRowProps} + currentTimeEstimate="1 min 31 sec" + customGasPriceInHex="mockCustomGasPriceInHex" + customGasLimitInHex="mockCustomGasLimitInHex" + insufficientBalance={false} + disableSave={false} + hideBasic + /> + )) const renderTabsResult = wrapper.instance().renderTabs() const renderedTabs = shallow(renderTabsResult) diff --git a/ui/app/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js b/ui/app/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js index 0412b3381..b578ff1ed 100644 --- a/ui/app/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js +++ b/ui/app/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js @@ -49,13 +49,15 @@ export default class GasPriceButtonGroup extends Component { className, showCheck, }) { - return (
- { gasEstimateType &&
{ this.gasEstimateTypeLabel(gasEstimateType) }
} - { timeEstimate &&
{ timeEstimate }
} - { feeInPrimaryCurrency &&
{ feeInPrimaryCurrency }
} - { feeInSecondaryCurrency &&
{ feeInSecondaryCurrency }
} - { showCheck &&
} -
) + return ( +
+ { gasEstimateType &&
{ this.gasEstimateTypeLabel(gasEstimateType) }
} + { timeEstimate &&
{ timeEstimate }
} + { feeInPrimaryCurrency &&
{ feeInPrimaryCurrency }
} + { feeInSecondaryCurrency &&
{ feeInSecondaryCurrency }
} + { showCheck &&
} +
+ ) } renderButton ({ @@ -88,14 +90,16 @@ export default class GasPriceButtonGroup extends Component { return ( !buttonDataLoading - ? - { gasButtonInfo.map((obj, index) => this.renderButton(obj, buttonPropsAndFlags, index)) } - + ? ( + + { gasButtonInfo.map((obj, index) => this.renderButton(obj, buttonPropsAndFlags, index)) } + + ) :
{ this.context.t('loading') }
) } diff --git a/ui/app/components/app/gas-customization/gas-price-button-group/tests/gas-price-button-group-component.test.js b/ui/app/components/app/gas-customization/gas-price-button-group/tests/gas-price-button-group-component.test.js index 85f53d08e..1d924f850 100644 --- a/ui/app/components/app/gas-customization/gas-price-button-group/tests/gas-price-button-group-component.test.js +++ b/ui/app/components/app/gas-customization/gas-price-button-group/tests/gas-price-button-group-component.test.js @@ -48,9 +48,11 @@ describe('GasPriceButtonGroup Component', function () { let wrapper beforeEach(() => { - wrapper = shallow() + wrapper = shallow(( + + )) }) afterEach(() => { diff --git a/ui/app/components/app/gas-customization/gas-slider/gas-slider.component.js b/ui/app/components/app/gas-customization/gas-slider/gas-slider.component.js index 8233dedb5..629d81f0e 100644 --- a/ui/app/components/app/gas-customization/gas-slider/gas-slider.component.js +++ b/ui/app/components/app/gas-customization/gas-slider/gas-slider.component.js @@ -36,7 +36,7 @@ export default class GasSlider extends Component { onChange={event => onChange(event.target.value)} />
-
+
{lowLabel} diff --git a/ui/app/components/app/input-number.js b/ui/app/components/app/input-number.js index d511dd0d6..7506808b3 100644 --- a/ui/app/components/app/input-number.js +++ b/ui/app/components/app/input-number.js @@ -69,7 +69,8 @@ InputNumber.prototype.render = function InputNumber () { /> {unitLabel}
-
this.setValue(addCurrencies(value, step, { toNumericBase: 'dec' }))} > diff --git a/ui/app/components/app/loading-network-screen/loading-network-screen.component.js b/ui/app/components/app/loading-network-screen/loading-network-screen.component.js index 97b16d08f..22419aabe 100644 --- a/ui/app/components/app/loading-network-screen/loading-network-screen.component.js +++ b/ui/app/components/app/loading-network-screen/loading-network-screen.component.js @@ -61,42 +61,46 @@ export default class LoadingNetworkScreen extends PureComponent { } renderLoadingScreenContent = () => { - return
- - {this.renderMessage()} -
+ return ( +
+ + {this.renderMessage()} +
+ ) } renderErrorScreenContent = () => { const { showNetworkDropdown, setProviderArgs, setProviderType } = this.props - return
- 😞 - { this.context.t('somethingWentWrong') } -
- + return ( +
+ 😞 + { this.context.t('somethingWentWrong') } +
+ - + +
-
+ ) } cancelCall = () => { diff --git a/ui/app/components/app/modals/account-details-modal/account-details-modal.component.js b/ui/app/components/app/modals/account-details-modal/account-details-modal.component.js index 1b9a6a718..b2ed1a8cc 100644 --- a/ui/app/components/app/modals/account-details-modal/account-details-modal.component.js +++ b/ui/app/components/app/modals/account-details-modal/account-details-modal.component.js @@ -56,7 +56,7 @@ export default class AccountDetailsModal extends Component { }} /> -
+
+ ? ( + + ) : null } diff --git a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js index 7fe79be5b..7bea983b4 100644 --- a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js +++ b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js @@ -78,7 +78,9 @@ export default class ConfirmRemoveAccount extends Component { + target="_blank" + href="https://metamask.zendesk.com/hc/en-us/articles/360015289932" + > { t('learnMore') }
diff --git a/ui/app/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js b/ui/app/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js index c251aee66..d503d950e 100644 --- a/ui/app/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js +++ b/ui/app/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js @@ -84,7 +84,8 @@ export default class DepositEtherModal extends Component { return (
+ className="page-container page-container--full-width page-container--full-height" + >
{this.context.t('depositEther')} diff --git a/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.component.js b/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.component.js index 53ff473e4..661bbdefd 100644 --- a/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.component.js +++ b/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.component.js @@ -76,18 +76,22 @@ export default class EditApprovalPermission extends PureComponent { className="edit-approval-permission__edit-section__radio-button" onClick={() => this.setState({ selectedOptionIsUnlimited: true })} > -
+
{ selectedOptionIsUnlimited &&
}
-
+
{ tokenAmount < tokenBalance ? t('proposedApprovalLimit') @@ -107,18 +111,22 @@ export default class EditApprovalPermission extends PureComponent { className="edit-approval-permission__edit-section__radio-button" onClick={() => this.setState({ selectedOptionIsUnlimited: false })} > -
+
{ !selectedOptionIsUnlimited &&
}
-
+
{ t('customSpendLimit') }
diff --git a/ui/app/components/app/modals/export-private-key-modal/export-private-key-modal.component.js b/ui/app/components/app/modals/export-private-key-modal/export-private-key-modal.component.js index 264bcc041..fd70cbc5b 100644 --- a/ui/app/components/app/modals/export-private-key-modal/export-private-key-modal.component.js +++ b/ui/app/components/app/modals/export-private-key-modal/export-private-key-modal.component.js @@ -149,7 +149,7 @@ export default class ExportPrivateKeyModal extends Component { inputClass="qr-ellip-address ellip-address" value={checksumAddress(address)} /> -
+
{this.context.t('showPrivateKeys')}
{this.renderPasswordLabel(privateKey)} diff --git a/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.component.js b/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.component.js index 6f3225382..9dc953315 100644 --- a/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.component.js +++ b/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.component.js @@ -75,7 +75,8 @@ export default class MetaMetricsOptInModal extends Component {
- This data is aggregated and is therefore anonymous for the purposes of General Data Protection Regulation (EU) 2016/679. For more information in relation to our privacy practices, please see our this.setState({ showAll: !showAll })} > - {childrenToRender.length > 1 ? : null} + {childrenToRender.length > 1 ? ( + + ) : null}
) diff --git a/ui/app/components/app/network-display/network-display.component.js b/ui/app/components/app/network-display/network-display.component.js index bcac637bd..1ecec3179 100644 --- a/ui/app/components/app/network-display/network-display.component.js +++ b/ui/app/components/app/network-display/network-display.component.js @@ -38,13 +38,15 @@ export default class NetworkDisplay extends Component { return networkClass ?
- :
+ : ( +
+ ) } render () { @@ -61,13 +63,15 @@ export default class NetworkDisplay extends Component { { networkClass ?
- :
+ : ( +
+ ) }
{ type === 'rpc' && nickname ? nickname : this.context.t(type) } diff --git a/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js b/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js index 4062b130f..4f94015b1 100644 --- a/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js +++ b/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js @@ -68,7 +68,7 @@ export default class ProviderPageContainerContent extends PureComponent {

{t('providerRequest', [title])}

{t('providerRequestInfo')} -
+
{ it('should render checksummed address', () => { - const wrapper = render(, { context: { t: () => {}}}) + const wrapper = render(( + + ), { context: { t: () => {}}}) // Checksummed version of address is displayed assert.equal(wrapper.find('.selected-account__address').text(), '0x1B82...5C9D') assert.equal(wrapper.find('.selected-account__name').text(), 'testName') diff --git a/ui/app/components/app/sidebars/sidebar.component.js b/ui/app/components/app/sidebars/sidebar.component.js index 484b87e4b..6437675c9 100644 --- a/ui/app/components/app/sidebars/sidebar.component.js +++ b/ui/app/components/app/sidebars/sidebar.component.js @@ -20,13 +20,15 @@ export default class Sidebar extends Component { renderOverlay () { const { onOverlayClose } = this.props - return

{ - onOverlayClose && onOverlayClose() - this.props.hideSidebar() - } - } /> + return ( +
{ + onOverlayClose && onOverlayClose() + this.props.hideSidebar() + }} + /> + ) } renderSidebarContent () { diff --git a/ui/app/components/app/sidebars/tests/sidebars-component.test.js b/ui/app/components/app/sidebars/tests/sidebars-component.test.js index 5f6657dde..3416ad8f6 100644 --- a/ui/app/components/app/sidebars/tests/sidebars-component.test.js +++ b/ui/app/components/app/sidebars/tests/sidebars-component.test.js @@ -16,12 +16,14 @@ describe('Sidebar Component', function () { let wrapper beforeEach(() => { - wrapper = shallow() + wrapper = shallow(( + + )) }) afterEach(() => { diff --git a/ui/app/components/app/signature-request-original/signature-request-original.component.js b/ui/app/components/app/signature-request-original/signature-request-original.component.js index 2485ae506..9a92ba5fb 100644 --- a/ui/app/components/app/signature-request-original/signature-request-original.component.js +++ b/ui/app/components/app/signature-request-original/signature-request-original.component.js @@ -171,22 +171,26 @@ export default class SignatureRequestOriginal extends Component {
{ domain - ?
-

- Domain -

- -
+ ? ( +
+

+ Domain +

+ +
+ ) : '' } { message - ?
-

- Message -

- -
+ ? ( +
+

+ Message +

+ +
+ ) : '' }
@@ -221,16 +225,18 @@ export default class SignatureRequestOriginal extends Component { { notice } { type === 'eth_sign' - ? { - global.platform.openWindow({ - url: 'https://metamask.zendesk.com/hc/en-us/articles/360015488751', - }) - }} - > - { this.context.t('learnMore') } - + ? ( + { + global.platform.openWindow({ + url: 'https://metamask.zendesk.com/hc/en-us/articles/360015488751', + }) + }} + > + { this.context.t('learnMore') } + + ) : null }
diff --git a/ui/app/components/app/signature-request/signature-request-header/signature-request-header.component.js b/ui/app/components/app/signature-request/signature-request-header/signature-request-header.component.js index 3ac0c9afb..661a933a0 100644 --- a/ui/app/components/app/signature-request/signature-request-header/signature-request-header.component.js +++ b/ui/app/components/app/signature-request/signature-request-header/signature-request-header.component.js @@ -14,10 +14,12 @@ export default class SignatureRequestHeader extends PureComponent { return (
- {selectedAccount && } + {selectedAccount && ( + + )} {name}
diff --git a/ui/app/components/app/signature-request/tests/signature-request.test.js b/ui/app/components/app/signature-request/tests/signature-request.test.js index 68b114dd8..6ff07effc 100644 --- a/ui/app/components/app/signature-request/tests/signature-request.test.js +++ b/ui/app/components/app/signature-request/tests/signature-request.test.js @@ -8,11 +8,16 @@ describe('Signature Request Component', function () { let wrapper beforeEach(() => { - wrapper = shallow() + wrapper = shallow(( + + )) }) describe('render', () => { diff --git a/ui/app/components/app/token-cell/token-cell.component.js b/ui/app/components/app/token-cell/token-cell.component.js index 10a3447d1..dc2bbb6d3 100644 --- a/ui/app/components/app/token-cell/token-cell.component.js +++ b/ui/app/components/app/token-cell/token-cell.component.js @@ -107,7 +107,8 @@ export default class TokenCell extends Component {
)}
- { e.stopPropagation() this.setState({ tokenMenuOpen: true }) diff --git a/ui/app/components/app/token-list.js b/ui/app/components/app/token-list.js index 7917cd54a..ee2f85cac 100644 --- a/ui/app/components/app/token-list.js +++ b/ui/app/components/app/token-list.js @@ -66,12 +66,16 @@ TokenList.prototype.render = function TokenList () { if (error) { log.error(error) return ( -
+
{this.context.t('troubleTokenBalances')} { }, } - const wrapper = shallow(, { context: { t }}) + const wrapper = shallow(( + + ), { context: { t }}) assert.equal(wrapper.find('.transaction-action').length, 1) wrapper.setState({ transactionAction: 'sentEther' }) diff --git a/ui/app/components/app/transaction-breakdown/transaction-breakdown.component.js b/ui/app/components/app/transaction-breakdown/transaction-breakdown.component.js index 5642e0fa5..0e1073337 100644 --- a/ui/app/components/app/transaction-breakdown/transaction-breakdown.component.js +++ b/ui/app/components/app/transaction-breakdown/transaction-breakdown.component.js @@ -50,10 +50,12 @@ export default class TransactionBreakdown extends PureComponent { className="transaction-breakdown__row-title" > {typeof gas !== 'undefined' - ? + ? ( + + ) : '?' } @@ -72,13 +74,15 @@ export default class TransactionBreakdown extends PureComponent { } {typeof gasPrice !== 'undefined' - ? + ? ( + + ) : '?' } diff --git a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.component.js b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.component.js index 554e99a5b..f3bd51b93 100644 --- a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.component.js +++ b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.component.js @@ -191,15 +191,17 @@ export default class TransactionListItemDetails extends PureComponent { { - showRetry && - - + showRetry && ( + + + + ) }
diff --git a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js index 9ab0105f9..3106f7fc3 100644 --- a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js +++ b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js @@ -236,18 +236,22 @@ export default class TransactionListItem extends PureComponent { )} /> { showEstimatedTime - ? + ? ( + + ) : null } { this.renderPrimaryCurrency() } { this.renderSecondaryCurrency() }
-
+
{ showTransactionDetails && (
diff --git a/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js b/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js index 0e2882e9c..d948355fc 100644 --- a/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js +++ b/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js @@ -25,14 +25,16 @@ describe('TransactionViewBalance Component', () => { }) it('should render ETH balance properly', () => { - const wrapper = shallow(, { context: { t, metricsEvent } }) + const wrapper = shallow(( + + ), { context: { t, metricsEvent } }) assert.equal(wrapper.find('.transaction-view-balance').length, 1) assert.equal(wrapper.find('.transaction-view-balance__button').length, 2) @@ -55,15 +57,17 @@ describe('TransactionViewBalance Component', () => { symbol: 'ABC', } - const wrapper = shallow(, { context: { t } }) + const wrapper = shallow(( + + ), { context: { t } }) assert.equal(wrapper.find('.transaction-view-balance').length, 1) assert.equal(wrapper.find('.transaction-view-balance__button').length, 1) diff --git a/ui/app/components/app/wallet-view/wallet-view.component.js b/ui/app/components/app/wallet-view/wallet-view.component.js index bf3c97650..ceccfea51 100644 --- a/ui/app/components/app/wallet-view/wallet-view.component.js +++ b/ui/app/components/app/wallet-view/wallet-view.component.js @@ -44,9 +44,11 @@ export default class WalletView extends Component { } = this.props return ( -
+
{ diff --git a/ui/app/components/ui/button-group/button-group.stories.js b/ui/app/components/ui/button-group/button-group.stories.js index c58c628b3..1596680c1 100644 --- a/ui/app/components/ui/button-group/button-group.stories.js +++ b/ui/app/components/ui/button-group/button-group.stories.js @@ -6,7 +6,7 @@ import Button from '../button' import { text, boolean } from '@storybook/addon-knobs/react' storiesOf('ButtonGroup', module) - .add('with Buttons', () => + .add('with Buttons', () => ( - ) - .add('with a disabled Button', () => + )) + .add('with a disabled Button', () => ( - ) + )) diff --git a/ui/app/components/ui/button-group/tests/button-group-component.test.js b/ui/app/components/ui/button-group/tests/button-group-component.test.js index 663d86c74..b07b16cc9 100644 --- a/ui/app/components/ui/button-group/tests/button-group-component.test.js +++ b/ui/app/components/ui/button-group/tests/button-group-component.test.js @@ -21,12 +21,16 @@ describe('ButtonGroup Component', function () { let wrapper beforeEach(() => { - wrapper = shallow({mockButtons}) + wrapper = shallow(( + + {mockButtons} + + )) }) afterEach(() => { diff --git a/ui/app/components/ui/button/button.stories.js b/ui/app/components/ui/button/button.stories.js index 9df53439d..6540d5aa1 100644 --- a/ui/app/components/ui/button/button.stories.js +++ b/ui/app/components/ui/button/button.stories.js @@ -6,7 +6,7 @@ import { text, boolean } from '@storybook/addon-knobs/react' // ', 'secondary', 'default', 'warning', 'danger', 'danger-primary', 'link'], 'primary')} storiesOf('Button', module) - .add('Button - Primary', () => + .add('Button - Primary', () => ( - ) - .add('Button - Secondary', () => + )) + .add('Button - Secondary', () => ( - ) - .add('Button - Default', () => + )) + .add('Button - Default', () => ( - ) - .add('Button - Warning', () => + )) + .add('Button - Warning', () => ( - ) - .add('Button - Danger', () => + )) + .add('Button - Danger', () => ( - ) - .add('Button - Danger Primary', () => + )) + .add('Button - Danger Primary', () => ( - ) - .add('Button - Link', () => + )) + .add('Button - Link', () => ( - ) + )) diff --git a/ui/app/components/ui/currency-display/tests/currency-display.component.test.js b/ui/app/components/ui/currency-display/tests/currency-display.component.test.js index d9ef052f1..387493da6 100644 --- a/ui/app/components/ui/currency-display/tests/currency-display.component.test.js +++ b/ui/app/components/ui/currency-display/tests/currency-display.component.test.js @@ -5,21 +5,25 @@ import CurrencyDisplay from '../currency-display.component' describe('CurrencyDisplay Component', () => { it('should render text with a className', () => { - const wrapper = shallow() + const wrapper = shallow(( + + )) assert.ok(wrapper.hasClass('currency-display')) assert.equal(wrapper.text(), '$123.45') }) it('should render text with a prefix', () => { - const wrapper = shallow() + const wrapper = shallow(( + + )) assert.ok(wrapper.hasClass('currency-display')) assert.equal(wrapper.text(), '-$123.45') diff --git a/ui/app/components/ui/eth-balance/eth-balance.component.js b/ui/app/components/ui/eth-balance/eth-balance.component.js index fedbcc192..925395602 100644 --- a/ui/app/components/ui/eth-balance/eth-balance.component.js +++ b/ui/app/components/ui/eth-balance/eth-balance.component.js @@ -67,29 +67,36 @@ export default class EthBalance extends Component { return (
-
-
+
+
{ incoming ? `+${balanceToRender}` : balanceToRender }
-
+
{label}
@@ -120,7 +127,8 @@ export default class EthBalance extends Component {
+ }} + > {this.renderBalance(formattedValue)}
diff --git a/ui/app/components/ui/hex-to-decimal/tests/hex-to-decimal.component.test.js b/ui/app/components/ui/hex-to-decimal/tests/hex-to-decimal.component.test.js index c98da9ad4..848ef2c4f 100644 --- a/ui/app/components/ui/hex-to-decimal/tests/hex-to-decimal.component.test.js +++ b/ui/app/components/ui/hex-to-decimal/tests/hex-to-decimal.component.test.js @@ -5,20 +5,24 @@ import HexToDecimal from '../hex-to-decimal.component' describe('HexToDecimal Component', () => { it('should render a prefixed hex as a decimal with a className', () => { - const wrapper = shallow() + const wrapper = shallow(( + + )) assert.ok(wrapper.hasClass('hex-to-decimal')) assert.equal(wrapper.text(), '12345') }) it('should render an unprefixed hex as a decimal with a className', () => { - const wrapper = shallow() + const wrapper = shallow(( + + )) assert.ok(wrapper.hasClass('hex-to-decimal')) assert.equal(wrapper.text(), '6789') diff --git a/ui/app/components/ui/identicon/tests/identicon.component.test.js b/ui/app/components/ui/identicon/tests/identicon.component.test.js index 2944818f5..b1efb158c 100644 --- a/ui/app/components/ui/identicon/tests/identicon.component.test.js +++ b/ui/app/components/ui/identicon/tests/identicon.component.test.js @@ -18,7 +18,7 @@ describe('Identicon', () => { it('renders default eth_logo identicon with no props', () => { const wrapper = mount( - + ) assert.equal(wrapper.find('img.balance-icon').prop('src'), './images/eth_logo.svg') diff --git a/ui/app/components/ui/page-container/page-container-footer/page-container-footer.component.js b/ui/app/components/ui/page-container/page-container-footer/page-container-footer.component.js index a2cf0100b..da8da45d1 100644 --- a/ui/app/components/ui/page-container/page-container-footer/page-container-footer.component.js +++ b/ui/app/components/ui/page-container/page-container-footer/page-container-footer.component.js @@ -37,14 +37,16 @@ export default class PageContainerFooter extends Component {
- {!hideCancel && } + {!hideCancel && ( + + )} + > + {this.context.t('cancel')} + + > + {this.context.t('create')} +
) diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js index 1fae5351c..53d4614ad 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js @@ -283,7 +283,8 @@ export default class ImportWithSeedPhrase extends PureComponent { {termsChecked ? : null}
- I have read and agree to the
: null}
- I have read and agree to the ) diff --git a/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.component.js b/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.component.js index ad1ffbf42..14c85b923 100644 --- a/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.component.js +++ b/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.component.js @@ -142,7 +142,8 @@ export default class MetaMetricsOptIn extends Component { disabled={false} /> diff --git a/ui/app/pages/home/home.component.js b/ui/app/pages/home/home.component.js index e51c82177..64526fe31 100644 --- a/ui/app/pages/home/home.component.js +++ b/ui/app/pages/home/home.component.js @@ -124,56 +124,62 @@ export default class Home extends PureComponent { { showPrivacyModeNotification - ? { - unsetMigratedPrivacyMode() - window.open('https://medium.com/metamask/42549d4870fa', '_blank', 'noopener') - }} - ignoreText={t('dismiss')} - onIgnore={() => { - unsetMigratedPrivacyMode() - }} - key="home-privacyModeDefault" - /> + ? ( + { + unsetMigratedPrivacyMode() + window.open('https://medium.com/metamask/42549d4870fa', '_blank', 'noopener') + }} + ignoreText={t('dismiss')} + onIgnore={() => { + unsetMigratedPrivacyMode() + }} + key="home-privacyModeDefault" + /> + ) : null } { shouldShowSeedPhraseReminder - ? { - if (isPopup) { - global.platform.openExtensionInBrowser(INITIALIZE_BACKUP_SEED_PHRASE_ROUTE) - } else { - history.push(INITIALIZE_BACKUP_SEED_PHRASE_ROUTE) - } - }} - infoText={t('backupApprovalInfo')} - key="home-backupApprovalNotice" - /> + ? ( + { + if (isPopup) { + global.platform.openExtensionInBrowser(INITIALIZE_BACKUP_SEED_PHRASE_ROUTE) + } else { + history.push(INITIALIZE_BACKUP_SEED_PHRASE_ROUTE) + } + }} + infoText={t('backupApprovalInfo')} + key="home-backupApprovalNotice" + /> + ) : null } { threeBoxLastUpdated && showRestorePrompt - ? { - restoreFromThreeBox(selectedAddress) - .then(() => { - turnThreeBoxSyncingOn() - }) - }} - onIgnore={() => { - setShowRestorePromptToFalse() - }} - key="home-privacyModeDefault" - /> + ? ( + { + restoreFromThreeBox(selectedAddress) + .then(() => { + turnThreeBoxSyncingOn() + }) + }} + onIgnore={() => { + setShowRestorePromptToFalse() + }} + key="home-privacyModeDefault" + /> + ) : null } { diff --git a/ui/app/pages/send/account-list-item/account-list-item.component.js b/ui/app/pages/send/account-list-item/account-list-item.component.js index 20ced2f09..8c676f419 100644 --- a/ui/app/pages/send/account-list-item/account-list-item.component.js +++ b/ui/app/pages/send/account-list-item/account-list-item.component.js @@ -44,30 +44,32 @@ export default class AccountListItem extends Component { const { name, address, balance } = account || {} - return (
handleClick && handleClick({ name, address, balance })} - > + return ( +
handleClick && handleClick({ name, address, balance })} + > -
- +
+ -
{ name || address }
+
{ name || address }
- {icon &&
{ icon }
} + {icon &&
{ icon }
} -
+
- {displayAddress && name &&
- { checksumAddress(address) } -
} + {displayAddress && name && ( +
+ { checksumAddress(address) } +
+ )} - { - displayBalance && ( + {displayBalance && ( -
+
{ - balanceIsCached ? * : null + balanceIsCached + ? * + : null }
- { - showFiat && ( - - ) - } + {showFiat && ( + + )}
- ) - } + )} -
) +
+ ) } } diff --git a/ui/app/pages/send/account-list-item/tests/account-list-item-component.test.js b/ui/app/pages/send/account-list-item/tests/account-list-item-component.test.js index 5a2bd5638..e54a8c493 100644 --- a/ui/app/pages/send/account-list-item/tests/account-list-item-component.test.js +++ b/ui/app/pages/send/account-list-item/tests/account-list-item-component.test.js @@ -23,17 +23,19 @@ describe('AccountListItem Component', function () { let wrapper beforeEach(() => { - wrapper = shallow(} - />, { context: { t: str => str + '_t' } }) + wrapper = shallow(( + } + /> + ), { context: { t: str => str + '_t' } }) }) afterEach(() => { diff --git a/ui/app/pages/send/send-content/add-recipient/add-recipient.component.js b/ui/app/pages/send/send-content/add-recipient/add-recipient.component.js index bad912c0a..a2e6b49db 100644 --- a/ui/app/pages/send/send-content/add-recipient/add-recipient.component.js +++ b/ui/app/pages/send/send-content/add-recipient/add-recipient.component.js @@ -155,7 +155,7 @@ export default class AddRecipient extends Component { className="send__select-recipient-wrapper__list__link" onClick={() => this.setState({ isShowingTransfer: false })} > -
+
{ t('backToAll') }
{ - wrapper = shallow(, { context: { t: str => str + '_t' } }) + wrapper = shallow(( + + ), { context: { t: str => str + '_t' } }) instance = wrapper.instance() }) diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js index 30ef4c678..48bc32d3a 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js @@ -18,15 +18,17 @@ describe('AmountMaxButton Component', function () { let instance beforeEach(() => { - wrapper = shallow(, { + wrapper = shallow(( + + ), { context: { t: str => str + '_t', metricsEvent: () => {}, diff --git a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js index bfc0f7e64..fe648d4d8 100644 --- a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js @@ -25,23 +25,25 @@ describe('SendAmountRow Component', function () { let instance beforeEach(() => { - wrapper = shallow(, { context: { t: str => str + '_t' } }) + wrapper = shallow(( + + ), { context: { t: str => str + '_t' } }) instance = wrapper.instance() }) diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js index 1dcd0bd2c..c0b604505 100644 --- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js @@ -128,7 +128,8 @@ export default class SendAssetRow extends Component { return (
this.selectToken(address)} >
diff --git a/ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js b/ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js index 5f5d26231..42b19397b 100644 --- a/ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js +++ b/ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js @@ -17,7 +17,7 @@ export default class SendDropdownList extends Component { getListItemIcon (accountAddress, activeAddress) { return accountAddress === activeAddress - ? + ? : null } @@ -29,24 +29,28 @@ export default class SendDropdownList extends Component { activeAddress, } = this.props - return (
-
closeDropdown()} - /> -
- {accounts.map((account, index) => { - onSelect(account) - closeDropdown() - }} - icon={this.getListItemIcon(account.address, activeAddress)} - key={`send-dropdown-account-#${index}`} - />)} + return ( +
+
closeDropdown()} + /> +
+ {accounts.map((account, index) => ( + { + onSelect(account) + closeDropdown() + }} + icon={this.getListItemIcon(account.address, activeAddress)} + key={`send-dropdown-account-#${index}`} + /> + ))} +
-
) + ) } } diff --git a/ui/app/pages/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js b/ui/app/pages/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js index bc6c97586..77efddfd4 100644 --- a/ui/app/pages/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js +++ b/ui/app/pages/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js @@ -17,16 +17,18 @@ describe('SendDropdownList Component', function () { let wrapper beforeEach(() => { - wrapper = shallow(, { context: { t: str => str + '_t' } }) + wrapper = shallow(( + + ), { context: { t: str => str + '_t' } }) }) afterEach(() => { @@ -39,7 +41,7 @@ describe('SendDropdownList Component', function () { it('should return check icon if the passed addresses are the same', () => { assert.deepEqual( wrapper.instance().getListItemIcon('mockAccount0', 'mockAccount0'), - + ) }) diff --git a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js index 37af59e29..473dbb0b1 100644 --- a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js +++ b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js @@ -38,12 +38,16 @@ export default class GasFeeDisplay extends Component {
) : gasLoadingError - ?
- {this.context.t('setGasPrice')} -
- :
- {this.context.t('loading')} -
+ ? ( +
+ {this.context.t('setGasPrice')} +
+ ) + : ( +
+ {this.context.t('loading')} +
+ ) } -
+ ? ( +
+ +
+ ) : null }
diff --git a/ui/app/pages/settings/settings.component.js b/ui/app/pages/settings/settings.component.js index 975ab4e35..b0ee55dc7 100644 --- a/ui/app/pages/settings/settings.component.js +++ b/ui/app/pages/settings/settings.component.js @@ -135,13 +135,19 @@ class SettingsPage extends PureComponent {
initialBreadCrumbRoute && history.push(initialBreadCrumbRoute)} - >{subheaderText}
- {breadCrumbTextKey &&
{' > '}{t(breadCrumbTextKey)}
} - {isAddressEntryPage &&
{' > '}{addressName}
} + > + {subheaderText} +
+ {breadCrumbTextKey && ( +
+ {' > '}{t(breadCrumbTextKey)} +
+ )} + {isAddressEntryPage && ( +
+ {' > '}{addressName} +
+ )}
) }