diff options
Diffstat (limited to 'ui/app/components')
25 files changed, 144 insertions, 166 deletions
diff --git a/ui/app/components/dropdowns/account-options-dropdown.js b/ui/app/components/dropdowns/account-options-dropdown.js index 7d7188ec4..50e793d87 100644 --- a/ui/app/components/dropdowns/account-options-dropdown.js +++ b/ui/app/components/dropdowns/account-options-dropdown.js @@ -12,6 +12,7 @@ module.exports = AccountOptionsDropdown // TODO: specify default props and proptypes // TODO: hook up to state, connect to redux to clean up API +// TODO: selectedAddress is not defined... should we use selected? AccountOptionsDropdown.prototype.render = function () { const { selected, network, identities, style, dropdownWrapperStyle, menuItemStyles } = this.props @@ -21,8 +22,8 @@ AccountOptionsDropdown.prototype.render = function () { selected: selectedAddress, network, identities, - style: !!style ? style : {}, - dropdownWrapperStyle: !!dropdownWrapperStyle ? dropdownWrapperStyle : {}, - menuItemStyles: !!menuItemStyles ? menuItemStyles : {}, + style: style || {}, + dropdownWrapperStyle: dropdownWrapperStyle || {}, + menuItemStyles: menuItemStyles || {}, }, []) } diff --git a/ui/app/components/dropdowns/account-selection-dropdown.js b/ui/app/components/dropdowns/account-selection-dropdown.js index ccb73bde7..7a8502d18 100644 --- a/ui/app/components/dropdowns/account-selection-dropdown.js +++ b/ui/app/components/dropdowns/account-selection-dropdown.js @@ -12,6 +12,7 @@ module.exports = AccountSelectionDropdown // TODO: specify default props and proptypes // TODO: hook up to state, connect to redux to clean up API +// TODO: selectedAddress is not defined... should we use selected? AccountSelectionDropdown.prototype.render = function () { const { selected, network, identities, style, dropdownWrapperStyle, menuItemStyles } = this.props @@ -21,8 +22,8 @@ AccountSelectionDropdown.prototype.render = function () { selected: selectedAddress, network, identities, - style: !!style ? style : {}, - dropdownWrapperStyle: !!dropdownWrapperStyle ? dropdownWrapperStyle : {}, - menuItemStyles: !!menuItemStyles ? menuItemStyles : {}, + style: style || {}, + dropdownWrapperStyle: dropdownWrapperStyle || {}, + menuItemStyles: menuItemStyles || {}, }, []) } diff --git a/ui/app/components/dropdowns/components/account-dropdowns.js b/ui/app/components/dropdowns/components/account-dropdowns.js index c340fdaed..1e869251a 100644 --- a/ui/app/components/dropdowns/components/account-dropdowns.js +++ b/ui/app/components/dropdowns/components/account-dropdowns.js @@ -25,7 +25,7 @@ class AccountDropdowns extends Component { } renderAccounts () { - const { identities, accounts, selected, menuItemStyles, dropdownWrapperStyle, actions } = this.props + const { identities, accounts, selected, menuItemStyles, actions } = this.props return Object.keys(identities).map((key, index) => { const identity = identities[key] @@ -57,13 +57,13 @@ class AccountDropdowns extends Component { flex: '1 1 0', minWidth: '20px', minHeight: '30px', - } + }, }, [ h('span', { style: { flex: '1 1 auto', fontSize: '14px', - } + }, }, isSelected ? h('i.fa.fa-check') : null), ]), @@ -86,7 +86,7 @@ class AccountDropdowns extends Component { alignItems: 'flex-start', justifyContent: 'center', marginLeft: '10px', - } + }, }, [ h('span.account-dropdown-name', { style: { @@ -102,7 +102,7 @@ class AccountDropdowns extends Component { style: { fontSize: '14px', }, - }, formattedBalance) + }, formattedBalance), ]), h('span', { @@ -119,17 +119,17 @@ class AccountDropdowns extends Component { }, }, [ 'Edit', - ]) + ]), ]), - ]) + ]), ] ) }) } renderAccountSelector () { - const { actions, dropdownWrapperStyle, useCssTransition, innerStyle } = this.props + const { actions, useCssTransition, innerStyle } = this.props const { accountSelectorActive, menuItemStyles } = this.state return h( @@ -323,7 +323,7 @@ class AccountDropdowns extends Component { } render () { - const { style, enableAccountsSelector, enableAccountOptions, dropdownWrapperStyle } = this.props + const { style, enableAccountsSelector, enableAccountOptions } = this.props const { optionsMenuActive, accountSelectorActive } = this.state return h( diff --git a/ui/app/components/dropdowns/index.js b/ui/app/components/dropdowns/index.js index d21c795f5..fa66f5000 100644 --- a/ui/app/components/dropdowns/index.js +++ b/ui/app/components/dropdowns/index.js @@ -1,7 +1,6 @@ // Reusable Dropdown Components -//TODO: Refactor into separate components +// TODO: Refactor into separate components const Dropdown = require('./components/dropdown').Dropdown -const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem const AccountDropdowns = require('./components/account-dropdowns') // App-Specific Instances @@ -15,4 +14,4 @@ module.exports = { NetworkDropdown, Dropdown, AccountDropdowns, -}
\ No newline at end of file +} diff --git a/ui/app/components/dropdowns/network-dropdown.js b/ui/app/components/dropdowns/network-dropdown.js index 6228513c9..0c002b2f0 100644 --- a/ui/app/components/dropdowns/network-dropdown.js +++ b/ui/app/components/dropdowns/network-dropdown.js @@ -23,6 +23,7 @@ function mapDispatchToProps (dispatch) { dispatch(actions.setProviderType(type)) }, setDefaultRpcTarget: () => { + // TODO: type is not defined. Is it needed? dispatch(actions.setDefaultRpcTarget(type)) }, setRpcTarget: (target) => { @@ -31,8 +32,8 @@ function mapDispatchToProps (dispatch) { showConfigPage: () => { dispatch(actions.showConfigPage()) }, - showNetworkDropdown: () => {dispatch(actions.showNetworkDropdown())}, - hideNetworkDropdown: () => {dispatch(actions.hideNetworkDropdown())}, + showNetworkDropdown: () => { dispatch(actions.showNetworkDropdown()) }, + hideNetworkDropdown: () => { dispatch(actions.hideNetworkDropdown()) }, } } @@ -49,7 +50,6 @@ NetworkDropdown.prototype.render = function () { const props = this.props const { provider: { type: providerType, rpcTarget: activeNetwork } } = props const rpcList = props.frequentRpcList - const state = this.state || {} const isOpen = this.props.networkDropdownOpen return h(Dropdown, { @@ -135,7 +135,7 @@ NetworkDropdown.prototype.render = function () { { key: 'rinkeby', closeMenu: () => this.props.hideNetworkDropdown(), - onClick: () => propssetProviderType('rinkeby'), + onClick: () => props.setProviderType('rinkeby'), style: { fontSize: '18px', }, diff --git a/ui/app/components/eth-balance.js b/ui/app/components/eth-balance.js index 84b719315..1be8c9731 100644 --- a/ui/app/components/eth-balance.js +++ b/ui/app/components/eth-balance.js @@ -3,7 +3,7 @@ const h = require('react-hyperscript') const { inherits } = require('util') const { formatBalance, - generateBalanceObject + generateBalanceObject, } = require('../util') const Tooltip = require('./tooltip.js') const FiatValue = require('./fiat-value.js') @@ -58,7 +58,7 @@ EthBalanceComponent.prototype.renderBalance = function (value) { const containerProps = hideTooltip ? {} : { position: 'bottom', title: `${ethNumber} ${ethSuffix}`, - }; + } return ( h(hideTooltip ? 'div' : Tooltip, diff --git a/ui/app/components/input-number.js b/ui/app/components/input-number.js index c8bdd5ec5..e3bbaf380 100644 --- a/ui/app/components/input-number.js +++ b/ui/app/components/input-number.js @@ -1,7 +1,6 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits -const findDOMNode = require('react-dom').findDOMNode module.exports = InputNumber @@ -13,13 +12,13 @@ function InputNumber () { value: 0, } - this.setValue = this.setValue.bind(this); + this.setValue = this.setValue.bind(this) } InputNumber.prototype.componentWillMount = function () { const { initValue = 0 } = this.props - - this.setState({ value: initValue }); + + this.setState({ value: initValue }) } InputNumber.prototype.setValue = function (newValue) { @@ -34,23 +33,23 @@ InputNumber.prototype.setValue = function (newValue) { } InputNumber.prototype.render = function () { - const { unitLabel, step = 1, min, placeholder } = this.props + const { unitLabel, step = 1, placeholder } = this.props const { value } = this.state - + return h('div.customize-gas-input-wrapper', {}, [ h('input.customize-gas-input', { placeholder, type: 'number', value, - onChange: (e) => this.setValue(Number(e.target.value)) + onChange: (e) => this.setValue(Number(e.target.value)), }), h('span.gas-tooltip-input-detail', {}, [unitLabel]), h('div.gas-tooltip-input-arrows', {}, [ h('i.fa.fa-angle-up', { - onClick: () => this.setValue(value + step) + onClick: () => this.setValue(value + step), }), h('i.fa.fa-angle-down', { - onClick: () => this.setValue(value - step) + onClick: () => this.setValue(value - step), }), ]), ]) diff --git a/ui/app/components/menu-droppo.js b/ui/app/components/menu-droppo.js index 66ab18954..2f173544e 100644 --- a/ui/app/components/menu-droppo.js +++ b/ui/app/components/menu-droppo.js @@ -19,7 +19,7 @@ MenuDroppoComponent.prototype.render = function () { this.manageListeners() - let style = this.props.style || {} + const style = this.props.style || {} if (!('position' in style)) { style.position = 'fixed' } diff --git a/ui/app/components/modals/account-details-modal.js b/ui/app/components/modals/account-details-modal.js index 3ed702192..fb0e70397 100644 --- a/ui/app/components/modals/account-details-modal.js +++ b/ui/app/components/modals/account-details-modal.js @@ -37,7 +37,7 @@ module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDetailsModa // fonts of qr-header and close button AccountDetailsModal.prototype.render = function () { - const { selectedIdentity, selectedAddress, network } = this.props + const { selectedIdentity, network } = this.props return h('div', {}, [ h('div.account-details-modal-wrapper', { @@ -63,12 +63,12 @@ AccountDetailsModal.prototype.render = function () { Qr: { message: this.props.selectedIdentity.name, data: this.props.selectedIdentity.address, - } + }, }, []), // divider h('div.account-details-modal-divider', { - style: {} + style: {}, }, []), h('button.btn-clear', { @@ -85,6 +85,6 @@ AccountDetailsModal.prototype.render = function () { 'Export private key', ]), - ]) + ]), ]) } diff --git a/ui/app/components/modals/buy-options-modal.js b/ui/app/components/modals/buy-options-modal.js index 6e0831768..79bbc798b 100644 --- a/ui/app/components/modals/buy-options-modal.js +++ b/ui/app/components/modals/buy-options-modal.js @@ -18,7 +18,7 @@ function mapDispatchToProps (dispatch) { }, hideModal: () => { dispatch(actions.hideModal()) - } + }, } } @@ -71,7 +71,7 @@ BuyOptions.prototype.render = function () { background: 'white', }, onClick: () => { this.props.hideModal() }, - }, h('div.buy-modal-content-footer#buy-modal-content-footer-text',{}, 'Cancel')), - ]) + }, h('div.buy-modal-content-footer#buy-modal-content-footer-text', {}, 'Cancel')), + ]), ]) } diff --git a/ui/app/components/modals/edit-account-name-modal.js b/ui/app/components/modals/edit-account-name-modal.js index ae5ca23d4..5c25ac245 100644 --- a/ui/app/components/modals/edit-account-name-modal.js +++ b/ui/app/components/modals/edit-account-name-modal.js @@ -71,6 +71,6 @@ EditAccountNameModal.prototype.render = function () { 'SAVE', ]), - ]) + ]), ]) } diff --git a/ui/app/components/modals/index.js b/ui/app/components/modals/index.js index e2e367af0..1db1d33d4 100644 --- a/ui/app/components/modals/index.js +++ b/ui/app/components/modals/index.js @@ -2,4 +2,4 @@ const Modal = require('./modal') module.exports = { Modal, -}
\ No newline at end of file +} diff --git a/ui/app/components/modals/modal.js b/ui/app/components/modals/modal.js index fdff4c99e..d266fe790 100644 --- a/ui/app/components/modals/modal.js +++ b/ui/app/components/modals/modal.js @@ -80,7 +80,7 @@ const MODALS = { contents: [], mobileModalStyle: {}, laptopModalStyle: {}, - } + }, } const BACKDROPSTYLE = { @@ -120,7 +120,7 @@ Modal.prototype.render = function () { { className: 'modal', keyboard: false, - onHide: () => {this.onHide()}, + onHide: () => { this.onHide() }, ref: (ref) => { this.modalRef = ref }, @@ -131,7 +131,7 @@ Modal.prototype.render = function () { ) } -Modal.prototype.componentWillReceiveProps = function(nextProps) { +Modal.prototype.componentWillReceiveProps = function (nextProps) { if (nextProps.active) { this.show() } else if (this.props.active) { @@ -139,17 +139,17 @@ Modal.prototype.componentWillReceiveProps = function(nextProps) { } } -Modal.prototype.onHide = function() { +Modal.prototype.onHide = function () { if (this.props.onHideCallback) { this.props.onHideCallback() } this.props.hideModal() } -Modal.prototype.hide = function() { +Modal.prototype.hide = function () { this.modalRef.hide() } -Modal.prototype.show = function() { +Modal.prototype.show = function () { this.modalRef.show() } diff --git a/ui/app/components/modals/new-account-modal.js b/ui/app/components/modals/new-account-modal.js index c44b79a2e..3caa515cd 100644 --- a/ui/app/components/modals/new-account-modal.js +++ b/ui/app/components/modals/new-account-modal.js @@ -38,14 +38,14 @@ NewAccountModal.prototype.render = function () { ]), h('div.modal-close-x', {}), - + h('div.new-account-modal-content', {}, [ 'Account Name', ]), h('div.new-account-input-wrapper', {}, [ h('input.new-account-input', { - placeholder: 'E.g. My new account' + placeholder: 'E.g. My new account', }, []), ]), @@ -62,6 +62,6 @@ NewAccountModal.prototype.render = function () { 'SAVE', ]), ]), - ]) + ]), ]) } diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 1c47440f2..5e5110d6c 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -8,17 +8,10 @@ const ethUtil = require('ethereumjs-util') const BN = ethUtil.BN const hexToBn = require('../../../app/scripts/lib/hex-to-bn') const util = require('../util') -const MiniAccountPanel = require('./mini-account-panel') -const Copyable = require('./copyable') -const EthBalance = require('./eth-balance') -const addressSummary = util.addressSummary -const nameForAddress = require('../../lib/contract-namer') -const BNInput = require('./bn-as-decimal-input') const MIN_GAS_PRICE_GWEI_BN = new BN(1) const GWEI_FACTOR = new BN(1e9) const MIN_GAS_PRICE_BN = MIN_GAS_PRICE_GWEI_BN.mul(GWEI_FACTOR) -const MIN_GAS_LIMIT_BN = new BN(21000) // Faked, for Icon @@ -34,8 +27,8 @@ const ARAGON = '960b236A07cf122663c4303350609A66A7B288C0' // actionButtons const sectionDivider = h('div', { style: { - height:'1px', - background:'#E7E7E7', + height: '1px', + background: '#E7E7E7', }, }) @@ -43,8 +36,8 @@ const contentDivider = h('div', { style: { marginLeft: '16px', marginRight: '16px', - height:'1px', - background:'#E7E7E7', + height: '1px', + background: '#E7E7E7', }, }) @@ -61,15 +54,13 @@ function PendingTx () { PendingTx.prototype.render = function () { const props = this.props - const { currentCurrency, blockGasLimit } = props + const { blockGasLimit } = props - const conversionRate = props.conversionRate const txMeta = this.gatherTxMeta() const txParams = txMeta.txParams || {} // Account Details const address = txParams.from || props.selectedAddress - const identity = props.identities[address] || { address: address } const account = props.accounts[address] const balance = account ? account.balance : '0x0' @@ -79,8 +70,6 @@ PendingTx.prototype.render = function () { // Gas const gas = txParams.gas const gasBn = hexToBn(gas) - const gasLimit = new BN(parseInt(blockGasLimit)) - const safeGasLimit = this.bnMultiplyByFraction(gasLimit, 19, 20).toString(10) // Gas Price const gasPrice = txParams.gasPrice || MIN_GAS_PRICE_BN.toString(16) @@ -90,8 +79,6 @@ PendingTx.prototype.render = function () { const valueBn = hexToBn(txParams.value) const maxCost = txFeeBn.add(valueBn) - const dataLength = txParams.data ? (txParams.data.length - 2) / 2 : 0 - const balanceBn = hexToBn(balance) const insufficientBalance = balanceBn.lt(maxCost) @@ -112,13 +99,13 @@ PendingTx.prototype.render = function () { marginRight: '3.5%', background: '#FFFFFF', // $background-white boxShadow: '0 2px 4px 0 rgba(0,0,0,0.08)', - } + }, }, [ h('section.flex-center.flex-row', { style: { zIndex: 15, // $token-icon-z-index marginTop: '-35px', - } + }, }, [ h(Identicon, { address: ARAGON, @@ -178,23 +165,23 @@ PendingTx.prototype.render = function () { h('div', { style: { width: '50%', - } + }, }, [ h('span', { style: { textAlign: 'left', fontSize: '12px', - } + }, }, [ - 'From' - ]) + 'From', + ]), ]), h('div', { style: { width: '50%', - } - },[ + }, + }, [ h('div', { style: { textAlign: 'left', @@ -208,8 +195,8 @@ PendingTx.prototype.render = function () { textAlign: 'left', fontSize: '8px', }, - }, 'Your Balance 2.34 ANT') - ]) + }, 'Your Balance 2.34 ANT'), + ]), ]), contentDivider, @@ -219,23 +206,23 @@ PendingTx.prototype.render = function () { h('div', { style: { width: '50%', - } + }, }, [ h('span', { style: { textAlign: 'left', fontSize: '12px', - } + }, }, [ - 'To' - ]) + 'To', + ]), ]), h('div', { style: { width: '50%', - } - },[ + }, + }, [ h('div', { style: { textAlign: 'left', @@ -249,8 +236,8 @@ PendingTx.prototype.render = function () { textAlign: 'left', fontSize: '8px', }, - }, '...5924') - ]) + }, '...5924'), + ]), ]), contentDivider, @@ -260,23 +247,23 @@ PendingTx.prototype.render = function () { h('div', { style: { width: '50%', - } + }, }, [ h('span', { style: { textAlign: 'left', fontSize: '12px', - } + }, }, [ - 'Gas Fee' - ]) + 'Gas Fee', + ]), ]), h('div', { style: { width: '50%', - } - },[ + }, + }, [ h('div', { style: { textAlign: 'left', @@ -290,8 +277,8 @@ PendingTx.prototype.render = function () { textAlign: 'left', fontSize: '8px', }, - }, '0.001575 ETH') - ]) + }, '0.001575 ETH'), + ]), ]), contentDivider, @@ -305,39 +292,39 @@ PendingTx.prototype.render = function () { paddingLeft: '6px', paddingRight: '6px', marginBottom: '10px', - } + }, }, [ h('div', { style: { width: '50%', - } + }, }, [ h('div', { style: { textAlign: 'left', fontSize: '12px', marginBottom: '-10px', - } + }, }, [ - 'Total Tokens' + 'Total Tokens', ]), h('div', { style: { textAlign: 'left', fontSize: '8px', - } + }, }, [ - 'Total Gas' - ]) + 'Total Gas', + ]), ]), h('div', { style: { width: '50%', - } - },[ + }, + }, [ h('div', { style: { textAlign: 'left', @@ -351,8 +338,8 @@ PendingTx.prototype.render = function () { textAlign: 'left', fontSize: '8px', }, - }, '0.249 ETH') - ]) + }, '0.249 ETH'), + ]), ]), ]), // end of container diff --git a/ui/app/components/qr-code.js b/ui/app/components/qr-code.js index 6559fcb7a..8d6b43b6c 100644 --- a/ui/app/components/qr-code.js +++ b/ui/app/components/qr-code.js @@ -4,7 +4,6 @@ const qrCode = require('qrcode-npm').qrcode const inherits = require('util').inherits const connect = require('react-redux').connect const isHexPrefixed = require('ethereumjs-util').isHexPrefixed -const CopyButton = require('./copyButton') module.exports = connect(mapStateToProps)(QrCodeView) diff --git a/ui/app/components/send/currency-toggle.js b/ui/app/components/send/currency-toggle.js index 37c026542..d3c2222a4 100644 --- a/ui/app/components/send/currency-toggle.js +++ b/ui/app/components/send/currency-toggle.js @@ -14,13 +14,13 @@ CurrencyToggle.prototype.render = function () { return h('span', {}, [ h('span', { className: currentCurrency === 'ETH' ? 'selected-currency' : 'unselected-currency', - onClick: () => onClick('ETH') + onClick: () => onClick('ETH'), }, ['ETH']), '<>', h('span', { className: currentCurrency === 'USD' ? 'selected-currency' : 'unselected-currency', - onClick: () => onClick('USD'), + onClick: () => onClick('USD'), }, ['USD']), - ]) //holding on icon from design + ]) // holding on icon from design } diff --git a/ui/app/components/send/gas-tooltip.js b/ui/app/components/send/gas-tooltip.js index 472a8e287..bef419e48 100644 --- a/ui/app/components/send/gas-tooltip.js +++ b/ui/app/components/send/gas-tooltip.js @@ -2,7 +2,6 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits const InputNumber = require('../input-number.js') -const findDOMNode = require('react-dom').findDOMNode module.exports = GasTooltip @@ -14,14 +13,14 @@ function GasTooltip () { gasPrice: 0, } - this.updateGasPrice = this.updateGasPrice.bind(this); - this.updateGasLimit = this.updateGasLimit.bind(this); - this.onClose = this.onClose.bind(this); + this.updateGasPrice = this.updateGasPrice.bind(this) + this.updateGasLimit = this.updateGasLimit.bind(this) + this.onClose = this.onClose.bind(this) } GasTooltip.prototype.componentWillMount = function () { const { gasPrice = 0, gasLimit = 0} = this.props - + this.setState({ gasPrice: parseInt(gasPrice, 16) / 1000000000, gasLimit: parseInt(gasLimit, 16), @@ -35,7 +34,7 @@ GasTooltip.prototype.updateGasPrice = function (newPrice) { this.setState({ gasPrice: newPrice }) onFeeChange({ gasLimit: gasLimit.toString(16), - gasPrice: (newPrice * 1000000000).toString(16) + gasPrice: (newPrice * 1000000000).toString(16), }) } @@ -46,29 +45,28 @@ GasTooltip.prototype.updateGasLimit = function (newLimit) { this.setState({ gasLimit: newLimit }) onFeeChange({ gasLimit: newLimit.toString(16), - gasPrice: (gasPrice * 1000000000).toString(16) + gasPrice: (gasPrice * 1000000000).toString(16), }) } GasTooltip.prototype.onClose = function (e) { - e.stopPropagation(); - this.props.onClose(); + e.stopPropagation() + this.props.onClose() } GasTooltip.prototype.render = function () { - const { position, title, children, className } = this.props const { gasPrice, gasLimit } = this.state return h('div.gas-tooltip', {}, [ h('div.gas-tooltip-close-area', { - onClick: this.onClose + onClick: this.onClose, }), h('div.customize-gas-tooltip-container', {}, [ h('div.customize-gas-tooltip', {}, [ h('div.gas-tooltip-header.gas-tooltip-label', {}, ['Customize Gas']), h('div.gas-tooltip-input-label', {}, [ h('span.gas-tooltip-label', {}, ['Gas Price']), - h('i.fa.fa-info-circle') + h('i.fa.fa-info-circle'), ]), h(InputNumber, { unitLabel: 'GWEI', @@ -76,7 +74,7 @@ GasTooltip.prototype.render = function () { min: 0, placeholder: '0', initValue: gasPrice, - onChange: (newPrice) => this.updateGasPrice(newPrice), + onChange: (newPrice) => this.updateGasPrice(newPrice), }), h('div.gas-tooltip-input-label', { style: { @@ -84,7 +82,7 @@ GasTooltip.prototype.render = function () { }, }, [ h('span.gas-tooltip-label', {}, ['Gas Limit']), - h('i.fa.fa-info-circle') + h('i.fa.fa-info-circle'), ]), h(InputNumber, { unitLabel: 'UNITS', @@ -92,11 +90,11 @@ GasTooltip.prototype.render = function () { min: 0, placeholder: '0', initValue: gasLimit, - onChange: (newLimit) => this.updateGasLimit(newLimit), + onChange: (newLimit) => this.updateGasLimit(newLimit), }), ]), h('div.gas-tooltip-arrow', {}), - ]) + ]), ]) } diff --git a/ui/app/components/shapeshift-form.js b/ui/app/components/shapeshift-form.js index 901a4a956..96a86d3b1 100644 --- a/ui/app/components/shapeshift-form.js +++ b/ui/app/components/shapeshift-form.js @@ -131,8 +131,8 @@ ShapeshiftForm.prototype.renderMain = function () { }, }, [ this.props.warning - ? this.props.warning - && h('span.error.flex-center', { + ? this.props.warning && + h('span.error.flex-center', { style: { textAlign: 'center', width: '229px', diff --git a/ui/app/components/tooltip.js b/ui/app/components/tooltip.js index 74cf1ae43..edbc074bb 100644 --- a/ui/app/components/tooltip.js +++ b/ui/app/components/tooltip.js @@ -12,7 +12,7 @@ function Tooltip () { Tooltip.prototype.render = function () { const props = this.props - const { position, title, children, show = true } = props + const { position, title, children } = props return h(ReactTooltip, { position: position || 'left', diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 9018bab06..eca2a7100 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -156,7 +156,7 @@ function failIfFailed (transaction) { } if (transaction.err || transaction.warning) { const { err, warning = {} } = transaction - const errFirst = !!(( err && warning ) || err) + const errFirst = !!((err && warning) || err) const message = errFirst ? err.message : warning.message errFirst ? err.message : warning.message diff --git a/ui/app/components/tx-list.js b/ui/app/components/tx-list.js index fb8d5c69b..92a9b6f46 100644 --- a/ui/app/components/tx-list.js +++ b/ui/app/components/tx-list.js @@ -6,8 +6,6 @@ const selectors = require('../selectors') const Identicon = require('./identicon') const { formatBalance, formatDate } = require('../util') -const valuesFor = require('../util').valuesFor - module.exports = connect(mapStateToProps)(TxList) function mapStateToProps (state) { @@ -28,7 +26,7 @@ const contentDivider = h('div.tx-list-content-divider', { TxList.prototype.render = function () { - const { txsToRender, conversionRate } = this.props + const { txsToRender } = this.props console.log('transactions to render', txsToRender) @@ -42,7 +40,7 @@ TxList.prototype.render = function () { }, [ h('div', { - style: {} + style: {}, }, 'TRANSACTIONS'), ]), @@ -69,41 +67,41 @@ TxList.prototype.renderTransactionListItem = function (transaction) { const { address, transactionStatus, transactionAmount, dateString } = props return h('div.flex-column.tx-list-item-wrapper', { - style: {} + style: {}, }, [ h('div.tx-list-date-wrapper', { - style: {} + style: {}, }, [ h('span.tx-list-date', {}, [ dateString, - ]) + ]), ]), h('div.flex-row.tx-list-content-wrapper', { - style: {} + style: {}, }, [ h('div.tx-list-identicon-wrapper', { - style: {} + style: {}, }, [ h(Identicon, { address, diameter: 24, - }) + }), ]), h('div.tx-list-account-and-status-wrapper', {}, [ h('div.tx-list-account-wrapper', { - style: {} + style: {}, }, [ h('span.tx-list-account', {}, [ - `${address.slice(0, 10)}...${address.slice(-4)}` + `${address.slice(0, 10)}...${address.slice(-4)}`, ]), ]), h('div.tx-list-status-wrapper', { - style: {} + style: {}, }, [ h('span.tx-list-status', {}, [ transactionStatus, @@ -112,7 +110,7 @@ TxList.prototype.renderTransactionListItem = function (transaction) { ]), h('div.flex-column.tx-list-details-wrapper', { - style: {} + style: {}, }, [ h('span.tx-list-value', {}, [ @@ -124,7 +122,7 @@ TxList.prototype.renderTransactionListItem = function (transaction) { ]), ]), - ]) + ]), ]) } diff --git a/ui/app/components/tx-view.js b/ui/app/components/tx-view.js index 5ed103421..9f75f7b31 100644 --- a/ui/app/components/tx-view.js +++ b/ui/app/components/tx-view.js @@ -5,7 +5,6 @@ const ethUtil = require('ethereumjs-util') const inherits = require('util').inherits const actions = require('../actions') -const WalletView = require('./wallet-view') const BalanceComponent = require('./balance-component') const TxList = require('./tx-list') const Identicon = require('./identicon') diff --git a/ui/app/components/wallet-content-display.js b/ui/app/components/wallet-content-display.js index 9c5db82d2..bfa061be4 100644 --- a/ui/app/components/wallet-content-display.js +++ b/ui/app/components/wallet-content-display.js @@ -18,7 +18,7 @@ WalletContentDisplay.prototype.render = function () { marginLeft: '1.3em', alignItems: 'flex-start', ...style, - } + }, }, [ h('span', { @@ -47,9 +47,9 @@ WalletContentDisplay.prototype.render = function () { height: '6em', width: '0.3em', background: '#D8D8D8', // $alto - } + }, }, [ - ]) + ]), ]) } diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js index 59859a8e0..6f9269389 100644 --- a/ui/app/components/wallet-view.js +++ b/ui/app/components/wallet-view.js @@ -4,7 +4,6 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const Identicon = require('./identicon') const AccountDropdowns = require('./dropdowns/index.js').AccountDropdowns -const Content = require('./wallet-content-display') const actions = require('../actions') const BalanceComponent = require('./balance-component') const selectors = require('../selectors') @@ -26,8 +25,8 @@ function mapStateToProps (state) { function mapDispatchToProps (dispatch) { return { - showSendPage: () => {dispatch(actions.showSendPage())}, - hideSidebar: () => {dispatch(actions.hideSidebar())}, + showSendPage: () => { dispatch(actions.showSendPage()) }, + hideSidebar: () => { dispatch(actions.hideSidebar()) }, } } @@ -36,12 +35,10 @@ function WalletView () { Component.call(this) } -const noop = () => {} - WalletView.prototype.render = function () { - const { network, responsiveDisplayClassname, style, identities, selectedAddress, selectedAccount, accounts, selectedIdentity } = this.props + const { network, responsiveDisplayClassname, identities, selectedAddress, selectedAccount, accounts, selectedIdentity } = this.props // temporary logs + fake extra wallets - console.log("walletview, selectedAccount:", selectedAccount) + console.log('walletview, selectedAccount:', selectedAccount) return h('div.wallet-view.flex-column' + (responsiveDisplayClassname || ''), { style: {}, @@ -49,7 +46,7 @@ WalletView.prototype.render = function () { // TODO: Separate component: wallet account details h('div.flex-column.wallet-view-account-details', { - style: {} + style: {}, }, [ h('div.flex-row.account-options-menu', { @@ -68,12 +65,12 @@ WalletView.prototype.render = function () { padding: '1px 15px', marginLeft: '-25px', position: 'absolute', - width: '122%', //TODO, refactor all of this component out into media queries + width: '122%', // TODO, refactor all of this component out into media queries }, menuItemStyles: { padding: '0px 0px', margin: '22px 0px', - } + }, }, []), ]), @@ -83,7 +80,7 @@ WalletView.prototype.render = function () { h('div', { style: { position: 'relative', - } + }, }, [ h(AccountDropdowns, { accounts, @@ -109,23 +106,23 @@ WalletView.prototype.render = function () { }), h('span.account-name', { - style: {} + style: {}, }, [ - selectedIdentity.name + selectedIdentity.name, ]), ]), ]), - //'Wallet' - Title + // 'Wallet' - Title // Not visible on mobile h('div.flex-column.wallet-view-title-wrapper', {}, [ h('span.wallet-view-title', {}, [ 'Wallet', - ]) + ]), ]), - //Wallet Balances + // Wallet Balances h('div.flex-column.wallet-balance-wrapper.wallet-balance-wrapper-active', {}, [ h('div.wallet-balance', {}, [ |