From 56e9f98bd05de8ae26f653d15eec4304f0c72155 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 2 Nov 2017 09:45:59 -0230 Subject: [PATCH] More lint fixes --- package.json | 1 + ui/app/actions.js | 12 ++++---- ui/app/app.js | 2 +- .../customize-gas-modal/gas-modal-card.js | 6 ++-- .../customize-gas-modal/gas-slider.js | 4 +-- .../components/customize-gas-modal/index.js | 16 +++++------ .../dropdowns/account-dropdown-mini.js | 10 +++---- .../dropdowns/token-menu-dropdown.js | 6 ++-- ui/app/components/modals/modal.js | 2 +- .../modals/shapeshift-deposit-tx-modal.js | 2 +- ui/app/components/network.js | 2 +- .../pending-tx/confirm-send-token.js | 2 +- ui/app/components/send-token/index.js | 8 +++--- ui/app/components/send/account-list-item.js | 2 +- ui/app/components/send/currency-display.js | 10 +++---- ui/app/components/send/eth-fee-display.js | 4 +-- ui/app/components/send/from-dropdown.js | 10 +++---- ui/app/components/send/gas-fee-display-v2.js | 5 ++-- ui/app/components/send/memo-textarea.js | 2 +- ui/app/components/send/send-utils.js | 4 +-- ui/app/components/send/send-v2-container.js | 8 +++--- ui/app/components/send/to-autocomplete.js | 13 ++++----- ui/app/components/send/usd-fee-display.js | 4 +-- ui/app/components/signature-request.js | 28 ++++++++----------- ui/app/components/token-cell.js | 12 ++++---- ui/app/components/tx-list-item.js | 6 ++-- ui/app/components/tx-list.js | 4 +-- ui/app/conf-tx.js | 2 +- ui/app/conversion-util.js | 18 ++++++------ ui/app/reducers/app.js | 4 +-- ui/app/reducers/metamask.js | 2 +- ui/app/send-v2.js | 8 +++--- ui/app/send.js | 4 +-- 33 files changed, 108 insertions(+), 115 deletions(-) diff --git a/package.json b/package.json index 28f35914f..1fea3656c 100644 --- a/package.json +++ b/package.json @@ -190,6 +190,7 @@ "enzyme": "^2.8.2", "eslint-plugin-chai": "0.0.1", "eslint-plugin-mocha": "^4.9.0", + "eslint-plugin-react": "^7.4.0", "eth-json-rpc-middleware": "^1.2.7", "fs-promise": "^2.0.3", "gulp": "github:gulpjs/gulp#4.0", diff --git a/ui/app/actions.js b/ui/app/actions.js index 28ae40f20..5d3befa63 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -430,7 +430,7 @@ function addNewAccount () { forceUpdateMetamaskState(dispatch) return resolve(newAccountAddress) }) - }); + }) } } @@ -621,7 +621,7 @@ function updateSendErrors (error) { function clearSend () { return { - type: actions.CLEAR_SEND + type: actions.CLEAR_SEND, } } @@ -1004,10 +1004,10 @@ function addTokens (tokens) { } } -function updateTokens(newTokens) { +function updateTokens (newTokens) { return { type: actions.UPDATE_TOKENS, - newTokens + newTokens, } } @@ -1081,7 +1081,7 @@ function setProviderType (type) { } } -function updateProviderType(type) { +function updateProviderType (type) { return { type: actions.SET_PROVIDER_TYPE, value: type, @@ -1239,7 +1239,7 @@ function exportAccount (password, address) { } } -function exportAccountComplete() { +function exportAccountComplete () { return { type: actions.EXPORT_ACCOUNT, } diff --git a/ui/app/app.js b/ui/app/app.js index 1470e1ecf..e90c3e98e 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -145,7 +145,7 @@ App.prototype.render = function () { (isLoading || isLoadingNetwork) && h(Loading, { loadingMessage: loadMessage, }), - + // this.renderLoadingIndicator({ isLoading, isLoadingNetwork, loadMessage }), // content diff --git a/ui/app/components/customize-gas-modal/gas-modal-card.js b/ui/app/components/customize-gas-modal/gas-modal-card.js index 0172d8afb..23754d819 100644 --- a/ui/app/components/customize-gas-modal/gas-modal-card.js +++ b/ui/app/components/customize-gas-modal/gas-modal-card.js @@ -21,7 +21,7 @@ GasModalCard.prototype.render = function () { // max, step, title, - copy + copy, } = this.props return h('div.send-v2__gas-modal-card', [ @@ -47,8 +47,8 @@ GasModalCard.prototype.render = function () { // min, // onChange, // }), - + ]) - + } diff --git a/ui/app/components/customize-gas-modal/gas-slider.js b/ui/app/components/customize-gas-modal/gas-slider.js index 7a9636094..69fd6f985 100644 --- a/ui/app/components/customize-gas-modal/gas-slider.js +++ b/ui/app/components/customize-gas-modal/gas-slider.js @@ -43,8 +43,8 @@ // h('div.gas-slider__high'), // ]), - + // ]) - + // } diff --git a/ui/app/components/customize-gas-modal/index.js b/ui/app/components/customize-gas-modal/index.js index 4bd9d079a..101a19d9f 100644 --- a/ui/app/components/customize-gas-modal/index.js +++ b/ui/app/components/customize-gas-modal/index.js @@ -58,7 +58,7 @@ function mapDispatchToProps (dispatch) { } } -function getOriginalState(props) { +function getOriginalState (props) { const gasPrice = props.gasPrice || MIN_GAS_PRICE_DEC const gasLimit = props.gasLimit || MIN_GAS_LIMIT_DEC @@ -90,7 +90,7 @@ CustomizeGasModal.prototype.save = function (gasPrice, gasLimit, gasTotal) { updateGasPrice, updateGasLimit, hideModal, - updateGasTotal + updateGasTotal, } = this.props updateGasPrice(gasPrice) @@ -126,9 +126,9 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) { }) if (!balanceIsSufficient) { - error = 'Insufficient balance for current gas total' + error = 'Insufficient balance for current gas total' } - + const gasLimitTooLow = gasLimit && conversionGreaterThan( { value: MIN_GAS_LIMIT_DEC, @@ -142,7 +142,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) { ) if (gasLimitTooLow) { - error = 'Gas limit must be at least 21000' + error = 'Gas limit must be at least 21000' } this.setState({ error }) @@ -219,7 +219,7 @@ CustomizeGasModal.prototype.render = function () { ]), h('div.send-v2__customize-gas__body', {}, [ - + h(GasModalCard, { value: convertedGasPrice, min: MIN_GAS_PRICE_GWEI, @@ -247,7 +247,7 @@ CustomizeGasModal.prototype.render = function () { error && h('div.send-v2__customize-gas__error-message', [ error, ]), - + h('div.send-v2__customize-gas__revert', { onClick: () => this.revert(), }, ['Revert']), @@ -260,7 +260,7 @@ CustomizeGasModal.prototype.render = function () { h(`div.send-v2__customize-gas__save${error ? '__error' : ''}`, { onClick: () => !error && this.save(gasPrice, gasLimit, gasTotal), }, ['SAVE']), - ]) + ]), ]), diff --git a/ui/app/components/dropdowns/account-dropdown-mini.js b/ui/app/components/dropdowns/account-dropdown-mini.js index f403c56b9..a3d41af90 100644 --- a/ui/app/components/dropdowns/account-dropdown-mini.js +++ b/ui/app/components/dropdowns/account-dropdown-mini.js @@ -37,13 +37,13 @@ AccountDropdownMini.prototype.renderDropdown = function () { ...accounts.map(account => h(AccountListItem, { account, displayBalance: false, - displayAddress: false, + displayAddress: false, handleClick: () => { onSelect(account) closeDropdown() - }, + }, icon: this.getListItemIcon(account, selectedAccount), - })) + })), ]), @@ -64,12 +64,12 @@ AccountDropdownMini.prototype.render = function () { handleClick: openDropdown, displayBalance: false, displayAddress: false, - icon: h(`i.fa.fa-caret-down.fa-lg`, { style: { color: '#dedede' } }) + icon: h(`i.fa.fa-caret-down.fa-lg`, { style: { color: '#dedede' } }), }), dropdownOpen && this.renderDropdown(), ]) - + } diff --git a/ui/app/components/dropdowns/token-menu-dropdown.js b/ui/app/components/dropdowns/token-menu-dropdown.js index 7234a9b21..dc7a985e3 100644 --- a/ui/app/components/dropdowns/token-menu-dropdown.js +++ b/ui/app/components/dropdowns/token-menu-dropdown.js @@ -10,7 +10,7 @@ function mapDispatchToProps (dispatch) { return { showHideTokenConfirmationModal: (token) => { dispatch(actions.showModal({ name: 'HIDE_TOKEN_CONFIRMATION', token })) - } + }, } } @@ -36,14 +36,14 @@ TokenMenuDropdown.prototype.render = function () { }), h('div.token-menu-dropdown__container', {}, [ h('div.token-menu-dropdown__options', {}, [ - + h('div.token-menu-dropdown__option', { onClick: (e) => { e.stopPropagation() showHideTokenConfirmationModal(this.props.token) this.props.onClose() }, - }, 'Hide Token') + }, 'Hide Token'), ]), ]), diff --git a/ui/app/components/modals/modal.js b/ui/app/components/modals/modal.js index e15dd6c1b..842081f40 100644 --- a/ui/app/components/modals/modal.js +++ b/ui/app/components/modals/modal.js @@ -220,7 +220,7 @@ Modal.prototype.render = function () { const children = modal.contents const modalStyle = modal[isMobileView() ? 'mobileModalStyle' : 'laptopModalStyle'] - const contentStyle = modal.contentStyle || {}; + const contentStyle = modal.contentStyle || {} return h(FadeModal, { diff --git a/ui/app/components/modals/shapeshift-deposit-tx-modal.js b/ui/app/components/modals/shapeshift-deposit-tx-modal.js index 1fd1ade00..24af5a0de 100644 --- a/ui/app/components/modals/shapeshift-deposit-tx-modal.js +++ b/ui/app/components/modals/shapeshift-deposit-tx-modal.js @@ -35,6 +35,6 @@ ShapeshiftDepositTxModal.prototype.render = function () { }, [ h('div', {}, [ h(QrView, {key: 'qr', Qr}), - ]) + ]), ]) } diff --git a/ui/app/components/network.js b/ui/app/components/network.js index 229d02e36..915818009 100644 --- a/ui/app/components/network.js +++ b/ui/app/components/network.js @@ -1,6 +1,6 @@ const Component = require('react').Component const h = require('react-hyperscript') -const classnames = require('classnames'); +const classnames = require('classnames') const inherits = require('util').inherits const NetworkDropdownIcon = require('./dropdowns/components/network-dropdown-icon') diff --git a/ui/app/components/pending-tx/confirm-send-token.js b/ui/app/components/pending-tx/confirm-send-token.js index 4a57553d7..3b8ae7f7f 100644 --- a/ui/app/components/pending-tx/confirm-send-token.js +++ b/ui/app/components/pending-tx/confirm-send-token.js @@ -144,7 +144,7 @@ ConfirmSendToken.prototype.getData = function () { const { value } = params[0] || {} const txMeta = this.gatherTxMeta() const txParams = txMeta.txParams || {} - + return { from: { address: txParams.from, diff --git a/ui/app/components/send-token/index.js b/ui/app/components/send-token/index.js index c5c7a0b46..99d078251 100644 --- a/ui/app/components/send-token/index.js +++ b/ui/app/components/send-token/index.js @@ -148,11 +148,11 @@ SendTokenScreen.prototype.setErrorsFor = function (field) { const { isValid, - errors: newErrors + errors: newErrors, } = this.validate() const nextErrors = Object.assign({}, previousErrors, { - [field]: newErrors[field] || null + [field]: newErrors[field] || null, }) if (!isValid) { @@ -166,7 +166,7 @@ SendTokenScreen.prototype.setErrorsFor = function (field) { SendTokenScreen.prototype.clearErrorsFor = function (field) { const { errors: previousErrors } = this.state const nextErrors = Object.assign({}, previousErrors, { - [field]: null + [field]: null, }) this.setState({ @@ -428,7 +428,7 @@ SendTokenScreen.prototype.render = function () { this.renderAmountInput(), this.renderGasInput(), this.renderMemoInput(), - warning && h('div.send-screen-input-wrapper--error', {}, + warning && h('div.send-screen-input-wrapper--error', {}, h('div.send-screen-input-wrapper__error-message', [ warning, ]) diff --git a/ui/app/components/send/account-list-item.js b/ui/app/components/send/account-list-item.js index cc514cbd4..2378a4671 100644 --- a/ui/app/components/send/account-list-item.js +++ b/ui/app/components/send/account-list-item.js @@ -68,4 +68,4 @@ AccountListItem.prototype.render = function () { }, name), ]) -} \ No newline at end of file +} diff --git a/ui/app/components/send/currency-display.js b/ui/app/components/send/currency-display.js index 34939c767..45986e371 100644 --- a/ui/app/components/send/currency-display.js +++ b/ui/app/components/send/currency-display.js @@ -71,7 +71,7 @@ CurrencyDisplay.prototype.render = function () { conversionRate, }) - const inputSizeMultiplier = readOnly ? 1 : 1.2; + const inputSizeMultiplier = readOnly ? 1 : 1.2 return h('div', { className, @@ -95,15 +95,13 @@ CurrencyDisplay.prototype.render = function () { if (newValue === '') { newValue = '0' - } - else if (newValue.match(/^0[1-9]$/)) { + } else if (newValue.match(/^0[1-9]$/)) { newValue = newValue.match(/[1-9]/)[0] } if (newValue && !isValidInput(newValue)) { event.preventDefault() - } - else { + } else { validate(this.getAmount(newValue)) this.setState({ value: newValue }) } @@ -122,6 +120,6 @@ CurrencyDisplay.prototype.render = function () { }, `${convertedValue} ${convertedCurrency.toUpperCase()}`), ]) - + } diff --git a/ui/app/components/send/eth-fee-display.js b/ui/app/components/send/eth-fee-display.js index 8b4cec16c..9eda5ec62 100644 --- a/ui/app/components/send/eth-fee-display.js +++ b/ui/app/components/send/eth-fee-display.js @@ -30,8 +30,8 @@ EthFeeDisplay.prototype.render = function () { color: '#5d5d5d', fontSize: '16px', fontFamily: 'DIN OT', - lineHeight: '22.4px' - } + lineHeight: '22.4px', + }, }) } diff --git a/ui/app/components/send/from-dropdown.js b/ui/app/components/send/from-dropdown.js index b404dde14..bcae5ede8 100644 --- a/ui/app/components/send/from-dropdown.js +++ b/ui/app/components/send/from-dropdown.js @@ -35,13 +35,13 @@ FromDropdown.prototype.renderDropdown = function () { h('div.send-v2__from-dropdown__list', {}, [ ...accounts.map(account => h(AccountListItem, { - account, + account, handleClick: () => { onSelect(account) closeDropdown() - }, + }, icon: this.getListItemIcon(account, selectedAccount), - })) + })), ]), @@ -60,12 +60,12 @@ FromDropdown.prototype.render = function () { h(AccountListItem, { account: selectedAccount, handleClick: openDropdown, - icon: h(`i.fa.fa-caret-down.fa-lg`, { style: { color: '#dedede' } }) + icon: h(`i.fa.fa-caret-down.fa-lg`, { style: { color: '#dedede' } }), }), dropdownOpen && this.renderDropdown(), ]) - + } diff --git a/ui/app/components/send/gas-fee-display-v2.js b/ui/app/components/send/gas-fee-display-v2.js index 0b4377d29..806c33f0a 100644 --- a/ui/app/components/send/gas-fee-display-v2.js +++ b/ui/app/components/send/gas-fee-display-v2.js @@ -30,14 +30,13 @@ GasFeeDisplay.prototype.render = function () { convertedPrefix: '$', readOnly: true, }) - : h('div.currency-display', 'Loading...') - , + : h('div.currency-display', 'Loading...'), h('div.send-v2__sliders-icon-container', { onClick, }, [ h('i.fa.fa-sliders.send-v2__sliders-icon'), - ]) + ]), ]) } diff --git a/ui/app/components/send/memo-textarea.js b/ui/app/components/send/memo-textarea.js index f5fe5e790..f4bb24bf8 100644 --- a/ui/app/components/send/memo-textarea.js +++ b/ui/app/components/send/memo-textarea.js @@ -28,6 +28,6 @@ // }), // ]) - + // } diff --git a/ui/app/components/send/send-utils.js b/ui/app/components/send/send-utils.js index 2def62842..6ec04a223 100644 --- a/ui/app/components/send/send-utils.js +++ b/ui/app/components/send/send-utils.js @@ -1,6 +1,6 @@ const { addCurrencies, conversionGreaterThan } = require('../../conversion-util') -function isBalanceSufficient({ +function isBalanceSufficient ({ amount, gasTotal, balance, @@ -35,4 +35,4 @@ function isBalanceSufficient({ module.exports = { isBalanceSufficient, -} \ No newline at end of file +} diff --git a/ui/app/components/send/send-v2-container.js b/ui/app/components/send/send-v2-container.js index efdf69795..5a6e83ae6 100644 --- a/ui/app/components/send/send-v2-container.js +++ b/ui/app/components/send/send-v2-container.js @@ -23,9 +23,9 @@ function mapStateToProps (state) { const selectedToken = getSelectedToken(state) const conversionRate = conversionRateSelector(state) - let data; - let primaryCurrency; - let tokenToFiatRate; + let data + let primaryCurrency + let tokenToFiatRate if (selectedToken) { data = Array.prototype.map.call( abi.rawEncode(['address', 'uint256'], [selectedAddress, '0x0']), @@ -70,6 +70,6 @@ function mapDispatchToProps (dispatch) { updateSendMemo: newMemo => dispatch(actions.updateSendMemo(newMemo)), updateSendErrors: newError => dispatch(actions.updateSendErrors(newError)), goHome: () => dispatch(actions.goHome()), - clearSend: () => dispatch(actions.clearSend()) + clearSend: () => dispatch(actions.clearSend()), } } diff --git a/ui/app/components/send/to-autocomplete.js b/ui/app/components/send/to-autocomplete.js index ebc63a7c5..df43fcc4a 100644 --- a/ui/app/components/send/to-autocomplete.js +++ b/ui/app/components/send/to-autocomplete.js @@ -37,15 +37,15 @@ ToAutoComplete.prototype.renderDropdown = function () { h('div.send-v2__from-dropdown__list', {}, [ ...accountsToRender.map(account => h(AccountListItem, { - account, + account, handleClick: () => { onChange(account.address) closeDropdown() - }, + }, icon: this.getListItemIcon(account.address, to), displayBalance: false, displayAddress: true, - })) + })), ]), @@ -67,8 +67,7 @@ ToAutoComplete.prototype.handleInputEvent = function (event = {}, cb) { this.setState({ accountsToRender: [] }) event.target && event.target.select() closeDropdown() - } - else { + } else { this.setState({ accountsToRender: matchingAccounts }) openDropdown() } @@ -93,13 +92,13 @@ ToAutoComplete.prototype.render = function () { h('input.send-v2__to-autocomplete__input', { placeholder: 'Recipient Address', - className: inError ? `send-v2__error-border` : '', + className: inError ? `send-v2__error-border` : '', value: to, onChange: event => onChange(event.target.value), onFocus: event => this.handleInputEvent(event), style: { borderColor: inError ? 'red' : null, - } + }, }), !to && h(`i.fa.fa-caret-down.fa-lg.send-v2__to-autocomplete__down-caret`, { diff --git a/ui/app/components/send/usd-fee-display.js b/ui/app/components/send/usd-fee-display.js index 6ee38f1b5..4cf31a493 100644 --- a/ui/app/components/send/usd-fee-display.js +++ b/ui/app/components/send/usd-fee-display.js @@ -28,8 +28,8 @@ USDFeeDisplay.prototype.render = function () { color: '#5d5d5d', fontSize: '16px', fontFamily: 'DIN OT', - lineHeight: '22.4px' - } + lineHeight: '22.4px', + }, }) } diff --git a/ui/app/components/signature-request.js b/ui/app/components/signature-request.js index 529449ff0..c5cc23aa8 100644 --- a/ui/app/components/signature-request.js +++ b/ui/app/components/signature-request.js @@ -27,13 +27,13 @@ function mapStateToProps (state) { requester: null, requesterAddress: null, accounts: accountsWithSendEtherInfoSelector(state), - conversionRate: conversionRateSelector(state) + conversionRate: conversionRateSelector(state), } } function mapDispatchToProps (dispatch) { return { - goHome: () => dispatch(actions.goHome()) + goHome: () => dispatch(actions.goHome()), } } @@ -84,7 +84,7 @@ SignatureRequest.prototype.renderAccountDropdown = function () { dropdownOpen: accountDropdownOpen, openDropdown: () => this.setState({ accountDropdownOpen: true }), closeDropdown: () => this.setState({ accountDropdownOpen: false }), - }) + }), ]) } @@ -113,7 +113,7 @@ SignatureRequest.prototype.renderAccountInfo = function () { return h('div.request-signature__account-info', [ this.renderAccountDropdown(), - + this.renderRequestIcon(), this.renderBalance(), @@ -128,7 +128,7 @@ SignatureRequest.prototype.renderRequestIcon = function () { h(Identicon, { diameter: 40, address: requesterAddress, - }) + }), ]) } @@ -137,7 +137,7 @@ SignatureRequest.prototype.renderRequestInfo = function () { h('div.request-signature__headline', [ `Your signature is being requested`, - ]) + ]), ]) } @@ -161,11 +161,9 @@ SignatureRequest.prototype.renderBody = function () { if (type === 'personal_sign') { rows = [{ name: 'Message', value: this.msgHexToText(data) }] - } - else if (type === 'eth_signTypedData') { + } else if (type === 'eth_signTypedData') { rows = data - } - else if (type === 'eth_sign') { + } else if (type === 'eth_sign') { rows = [{ name: 'Message', value: data }] notice = `Signing this message can have dangerous side effects. Only sign messages from @@ -183,14 +181,14 @@ SignatureRequest.prototype.renderBody = function () { className: classnames({ 'request-signature__notice': type === 'personal_sign' || type === 'eth_signTypedData', 'request-signature__warning': type === 'eth_sign', - }) + }), }, [notice]), h('div.request-signature__rows', [ ...rows.map(({ name, value }) => { return h('div.request-signature__row', [ - h('div.request-signature__row-title', [`${name}:`]), + h('div.request-signature__row-title', [`${name}:`]), h('div.request-signature__row-value', value), ]) }), @@ -218,12 +216,10 @@ SignatureRequest.prototype.renderFooter = function () { if (type === 'personal_sign') { cancel = cancelPersonalMessage sign = signPersonalMessage - } - else if (type === 'eth_signTypedData') { + } else if (type === 'eth_signTypedData') { cancel = cancelTypedMessage sign = signTypedMessage - } - else if (type === 'eth_sign') { + } else if (type === 'eth_sign') { cancel = cancelMessage sign = signMessage } diff --git a/ui/app/components/token-cell.js b/ui/app/components/token-cell.js index f55e23f9e..b40c0ec0d 100644 --- a/ui/app/components/token-cell.js +++ b/ui/app/components/token-cell.js @@ -67,11 +67,11 @@ TokenCell.prototype.render = function () { currentCurrency, // userAddress, } = props - - const pair = `${symbol.toLowerCase()}_eth`; - let currentTokenToFiatRate; - let currentTokenInFiat; + const pair = `${symbol.toLowerCase()}_eth` + + let currentTokenToFiatRate + let currentTokenInFiat let formattedFiat = '' if (tokenExchangeRates[pair]) { @@ -86,11 +86,11 @@ TokenCell.prototype.render = function () { numberOfDecimals: 2, conversionRate: currentTokenToFiatRate, }) - formattedFiat = `${currentTokenInFiat} ${currentCurrency.toUpperCase()}`; + formattedFiat = `${currentTokenInFiat} ${currentCurrency.toUpperCase()}` } const showFiat = Boolean(currentTokenInFiat) && currentCurrency.toUpperCase() !== symbol - + return ( h('div.token-list-item', { className: `token-list-item ${selectedTokenAddress === address ? 'token-list-item--active' : ''}`, diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js index ac7944ba2..26de19f15 100644 --- a/ui/app/components/tx-list-item.js +++ b/ui/app/components/tx-list-item.js @@ -138,8 +138,8 @@ TxListItem.prototype.getSendTokenTotal = async function () { const multiplier = Math.pow(10, Number(decimals || 0)) const total = Number(value / multiplier) - const pair = symbol && `${symbol.toLowerCase()}_eth`; - + const pair = symbol && `${symbol.toLowerCase()}_eth` + let tokenToFiatRate let totalInFiat @@ -242,6 +242,6 @@ TxListItem.prototype.render = function () { ]), ]), - ]) // holding on icon from design + ]), // holding on icon from design ]) } diff --git a/ui/app/components/tx-list.js b/ui/app/components/tx-list.js index 6ea8776af..70722f43e 100644 --- a/ui/app/components/tx-list.js +++ b/ui/app/components/tx-list.js @@ -22,7 +22,7 @@ function mapStateToProps (state) { function mapDispatchToProps (dispatch) { return { - showConfTxPage: ({ id }) => dispatch(showConfTxPage({ id })) + showConfTxPage: ({ id }) => dispatch(showConfTxPage({ id })), } } @@ -103,7 +103,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa tokenInfoGetter: this.tokenInfoGetter, } - const isUnapproved = transactionStatus === 'unapproved'; + const isUnapproved = transactionStatus === 'unapproved' if (isUnapproved) { opts.onClick = () => showConfTxPage({id: transActionId}) diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js index a91a1a1f9..9f273aaec 100644 --- a/ui/app/conf-tx.js +++ b/ui/app/conf-tx.js @@ -121,7 +121,7 @@ function currentTxView (opts) { return h(PendingTx, opts) } else if (msgParams) { log.debug('msgParams detected, rendering pending msg') - + return h(SignatureRequest, opts) // if (type === 'eth_sign') { diff --git a/ui/app/conversion-util.js b/ui/app/conversion-util.js index 3a7788ad1..9359d7c90 100644 --- a/ui/app/conversion-util.js +++ b/ui/app/conversion-util.js @@ -106,7 +106,7 @@ const converter = R.pipe( whenPredSetWithPropAndSetter(R.prop('numberOfDecimals'), 'numberOfDecimals', round), whenPropApplySetterMap('toNumericBase', baseChange), R.view(R.lensProp('value')) -); +) const conversionUtil = (value, { fromCurrency = null, @@ -129,7 +129,7 @@ const conversionUtil = (value, { conversionRate, invertConversionRate, value: value || '0', -}); +}) const addCurrencies = (a, b, options = {}) => { const { @@ -137,7 +137,7 @@ const addCurrencies = (a, b, options = {}) => { bBase, ...conversionOptions } = options - const value = (new BigNumber(a, aBase)).add(b, bBase); + const value = (new BigNumber(a, aBase)).add(b, bBase) return converter({ value, @@ -155,17 +155,17 @@ const multiplyCurrencies = (a, b, options = {}) => { const bigNumberA = new BigNumber(String(a), multiplicandBase) const bigNumberB = new BigNumber(String(b), multiplierBase) - const value = bigNumberA.times(bigNumberB); + const value = bigNumberA.times(bigNumberB) return converter({ value, - ...conversionOptions + ...conversionOptions, }) } const conversionGreaterThan = ( { ...firstProps }, - { ...secondProps }, + { ...secondProps }, ) => { const firstValue = converter({ ...firstProps }) const secondValue = converter({ ...secondProps }) @@ -174,7 +174,7 @@ const conversionGreaterThan = ( const conversionGTE = ( { ...firstProps }, - { ...secondProps }, + { ...secondProps }, ) => { const firstValue = converter({ ...firstProps }) const secondValue = converter({ ...secondProps }) @@ -183,7 +183,7 @@ const conversionGTE = ( const conversionLTE = ( { ...firstProps }, - { ...secondProps }, + { ...secondProps }, ) => { const firstValue = converter({ ...firstProps }) const secondValue = converter({ ...secondProps }) @@ -202,4 +202,4 @@ module.exports = { conversionGTE, conversionLTE, toNegative, -} \ No newline at end of file +} diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 6fb7f8cca..d84f264c9 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -44,7 +44,7 @@ function reduceApp (state, action) { }, previousModalState: { name: null, - } + }, }, sidebarOpen: false, networkDropdownOpen: false, @@ -100,7 +100,7 @@ function reduceApp (state, action) { state.appState.modal, { open: false }, { modalState: { name: null } }, - { previousModalState: appState.modal.modalState}, + { previousModalState: appState.modal.modalState}, ), }) diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index 7408f827a..50c9712ff 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -235,7 +235,7 @@ function reduceMetamask (state, action) { errors: { ...metamaskState.send.errors, ...action.value, - } + }, }, }) diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index 686de3209..6ce3e1b70 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -94,7 +94,7 @@ SendTransactionScreen.prototype.renderHeaderIcon = function () { diameter: 40, address: selectedToken.address, }) - : h('img.send-v2__send-header-icon', { src: '../images/eth_logo.svg' }) + : h('img.send-v2__send-header-icon', { src: '../images/eth_logo.svg' }), ]) } @@ -135,12 +135,12 @@ SendTransactionScreen.prototype.renderHeader = function () { ]) } -SendTransactionScreen.prototype.renderErrorMessage = function(errorType) { +SendTransactionScreen.prototype.renderErrorMessage = function (errorType) { const { errors } = this.props - const errorMessage = errors[errorType]; + const errorMessage = errors[errorType] return errorMessage - ? h('div.send-v2__error', [ errorMessage ] ) + ? h('div.send-v2__error', [ errorMessage ]) : null } diff --git a/ui/app/send.js b/ui/app/send.js index ce496d289..517b7690d 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -69,11 +69,11 @@ // amountToSend: '0x0', // gasPrice: null, // gas: null, -// amount: '0x0', +// amount: '0x0', // txData: null, // memo: '', // }, -// activeCurrency: 'USD', +// activeCurrency: 'USD', // tooltipIsOpen: false, // errors: {}, // isValid: false,