Lint fixes for NewUI-flat.

feature/default_network_editable
Dan 7 years ago
parent c8c918d44e
commit 5a94775b3f
  1. 2
      app/scripts/controllers/preferences.js
  2. 2
      ui/app/actions.js
  3. 7
      ui/app/app.js
  4. 5
      ui/app/components/customize-gas-modal/gas-modal-card.js
  5. 74
      ui/app/components/customize-gas-modal/gas-slider.js
  6. 3
      ui/app/components/customize-gas-modal/index.js
  7. 3
      ui/app/components/dropdowns/account-dropdown-mini.js
  8. 2
      ui/app/components/dropdowns/account-options-dropdown.js
  9. 2
      ui/app/components/dropdowns/account-selection-dropdown.js
  10. 15
      ui/app/components/dropdowns/components/account-dropdowns.js
  11. 1
      ui/app/components/dropdowns/components/dropdown.js
  12. 3
      ui/app/components/dropdowns/simple-dropdown.js
  13. 5
      ui/app/components/loading.js
  14. 2
      ui/app/components/modals/account-details-modal.js
  15. 1
      ui/app/components/modals/export-private-key-modal.js
  16. 4
      ui/app/components/pending-tx/confirm-send-token.js
  17. 1
      ui/app/components/send-token/index.js
  18. 3
      ui/app/components/send/currency-display.js
  19. 3
      ui/app/components/send/from-dropdown.js
  20. 2
      ui/app/components/send/gas-fee-display-v2.js
  21. 58
      ui/app/components/send/memo-textarea.js
  22. 1
      ui/app/components/send/send-constants.js
  23. 1
      ui/app/components/send/send-utils.js
  24. 6
      ui/app/components/send/send-v2-container.js
  25. 5
      ui/app/components/send/to-autocomplete.js
  26. 5
      ui/app/components/signature-request.js
  27. 7
      ui/app/components/tab-bar.js
  28. 26
      ui/app/components/token-list.js
  29. 4
      ui/app/components/transaction-list-item.js
  30. 2
      ui/app/components/tx-list-item.js
  31. 6
      ui/app/components/tx-list.js
  32. 2
      ui/app/conf-tx.js
  33. 8
      ui/app/conversion-util.js
  34. 8
      ui/app/send-v2.js
  35. 1094
      ui/app/send.js

@ -46,8 +46,6 @@ class PreferencesController {
}
removeToken (rawAddress) {
const address = normalizeAddress(rawAddress)
const tokens = this.store.getState().tokens
const updatedTokens = tokens.filter(token => token.address !== rawAddress)

@ -224,6 +224,8 @@ var actions = {
TOGGLE_ACCOUNT_MENU: 'TOGGLE_ACCOUNT_MENU',
toggleAccountMenu,
useEtherscanProvider,
}
module.exports = actions

@ -2,7 +2,6 @@ const inherits = require('util').inherits
const Component = require('react').Component
const connect = require('react-redux').connect
const h = require('react-hyperscript')
const { checkFeatureToggle } = require('../lib/feature-toggle-utils')
const actions = require('./actions')
// mascara
const MascaraFirstTime = require('../../mascara/src/app/first-time').default
@ -12,9 +11,7 @@ const InitializeMenuScreen = require('./first-time/init-menu')
const NewKeyChainScreen = require('./new-keychain')
// accounts
const MainContainer = require('./main-container')
const SendTransactionScreen = require('./send')
const SendTransactionScreen2 = require('./components/send/send-v2-container')
const SendTokenScreen = require('./components/send-token')
const ConfirmTxScreen = require('./conf-tx')
// notice
const NoticeScreen = require('./components/notice')
@ -27,7 +24,6 @@ const WalletView = require('./components/wallet-view')
const Settings = require('./settings')
const AddTokenScreen = require('./add-token')
const Import = require('./accounts/import')
const InfoScreen = require('./info')
const Loading = require('./components/loading')
const NetworkIndicator = require('./components/network')
const Identicon = require('./components/identicon')
@ -38,6 +34,7 @@ const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
const NetworkDropdown = require('./components/dropdowns/network-dropdown')
const AccountMenu = require('./components/account-menu')
const QrView = require('./components/qr-code')
// Global Modals
const Modal = require('./components/modals/index').Modal
@ -228,8 +225,6 @@ App.prototype.renderAppBar = function () {
}
const props = this.props
const state = this.state || {}
const isNetworkMenuOpen = state.isNetworkMenuOpen || false
const {isMascara, isOnboarding} = props
// Do not render header if user is in mascara onboarding

@ -2,7 +2,7 @@ const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const InputNumber = require('../input-number.js')
const GasSlider = require('./gas-slider.js')
// const GasSlider = require('./gas-slider.js')
module.exports = GasModalCard
@ -13,8 +13,7 @@ function GasModalCard () {
GasModalCard.prototype.render = function () {
const {
memo,
identities,
// memo,
onChange,
unitLabel,
value,

@ -1,50 +1,50 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
// const Component = require('react').Component
// const h = require('react-hyperscript')
// const inherits = require('util').inherits
module.exports = GasSlider
// module.exports = GasSlider
inherits(GasSlider, Component)
function GasSlider () {
Component.call(this)
}
// inherits(GasSlider, Component)
// function GasSlider () {
// Component.call(this)
// }
GasSlider.prototype.render = function () {
const {
memo,
identities,
onChange,
unitLabel,
value,
id,
step,
max,
min,
} = this.props
// GasSlider.prototype.render = function () {
// const {
// memo,
// identities,
// onChange,
// unitLabel,
// value,
// id,
// step,
// max,
// min,
// } = this.props
return h('div.gas-slider', [
// return h('div.gas-slider', [
h('input.gas-slider__input', {
type: 'range',
step,
max,
min,
value,
id: 'gasSlider',
onChange: event => onChange(event.target.value),
}, []),
// h('input.gas-slider__input', {
// type: 'range',
// step,
// max,
// min,
// value,
// id: 'gasSlider',
// onChange: event => onChange(event.target.value),
// }, []),
h('div.gas-slider__bar', [
// h('div.gas-slider__bar', [
h('div.gas-slider__low'),
// h('div.gas-slider__low'),
h('div.gas-slider__mid'),
// h('div.gas-slider__mid'),
h('div.gas-slider__high'),
// h('div.gas-slider__high'),
]),
// ]),
])
// ])
}
// }

@ -2,7 +2,6 @@ const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const ethUtil = require('ethereumjs-util')
const actions = require('../../actions')
const GasModalCard = require('./gas-modal-card')
@ -191,7 +190,7 @@ CustomizeGasModal.prototype.convertAndSetGasPrice = function (newGasPrice) {
}
CustomizeGasModal.prototype.render = function () {
const { hideModal, conversionRate } = this.props
const { hideModal } = this.props
const { gasPrice, gasLimit, gasTotal, error } = this.state
const convertedGasPrice = conversionUtil(gasPrice, {

@ -1,7 +1,6 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const Identicon = require('../identicon')
const AccountListItem = require('../send/account-list-item')
module.exports = AccountDropdownMini
@ -53,10 +52,8 @@ AccountDropdownMini.prototype.renderDropdown = function () {
AccountDropdownMini.prototype.render = function () {
const {
accounts,
selectedAccount,
openDropdown,
closeDropdown,
dropdownOpen,
} = this.props

@ -19,7 +19,7 @@ AccountOptionsDropdown.prototype.render = function () {
return h(AccountDropdowns, {
enableAccountOptions: true,
enableAccountsSelector: false,
selected: selectedAddress,
selected,
network,
identities,
style: style || {},

@ -19,7 +19,7 @@ AccountSelectionDropdown.prototype.render = function () {
return h(AccountDropdowns, {
enableAccountOptions: false,
enableAccountsSelector: true,
selected: selectedAddress,
selected,
network,
identities,
style: style || {},

@ -425,6 +425,21 @@ AccountDropdowns.propTypes = {
identities: PropTypes.objectOf(PropTypes.object),
selected: PropTypes.string,
keyrings: PropTypes.array,
accounts: PropTypes.object,
menuItemStyles: PropTypes.object,
actions: PropTypes.object,
// actions.showAccountDetail: ,
useCssTransition: PropTypes.bool,
innerStyle: PropTypes.object,
sidebarOpen: PropTypes.bool,
dropdownWrapperStyle: PropTypes.string,
// actions.showAccountDetailModal: ,
network: PropTypes.number,
// actions.showExportPrivateKeyModal: ,
style: PropTypes.object,
enableAccountsSelector: PropTypes.bool,
enableAccountOption: PropTypes.bool,
enableAccountOptions: PropTypes.bool,
}
const mapDispatchToProps = (dispatch) => {

@ -68,6 +68,7 @@ Dropdown.propTypes = {
onClickOutside: PropTypes.func,
innerStyle: PropTypes.object,
useCssTransition: PropTypes.bool,
containerClassName: PropTypes.string,
}
class DropdownMenuItem extends Component {

@ -1,4 +1,5 @@
const { Component, PropTypes } = require('react')
const { Component } = require('react')
const PropTypes = require('react').PropTypes
const h = require('react-hyperscript')
const classnames = require('classnames')
const R = require('ramda')

@ -1,5 +1,6 @@
const { Component } = require('react')
const h = require('react-hyperscript')
const PropTypes = require('react').PropTypes
class LoadingIndicator extends Component {
renderMessage () {
@ -35,4 +36,8 @@ class LoadingIndicator extends Component {
}
}
LoadingIndicator.propTypes = {
loadingMessage: PropTypes.string,
}
module.exports = LoadingIndicator

@ -4,7 +4,7 @@ const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../../actions')
const AccountModalContainer = require('./account-modal-container')
const { getSelectedIdentity, getSelectedAddress } = require('../../selectors')
const { getSelectedIdentity } = require('../../selectors')
const genAccountLink = require('../../../lib/account-link.js')
const QrView = require('../qr-code')
const EditableLabel = require('../editable-label')

@ -92,7 +92,6 @@ ExportPrivateKeyModal.prototype.renderButtons = function (privateKey, password,
ExportPrivateKeyModal.prototype.render = function () {
const {
selectedIdentity,
network,
warning,
showAccountDetailModal,
hideModal,

@ -10,7 +10,6 @@ const clone = require('clone')
const Identicon = require('../identicon')
const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN
const hexToBn = require('../../../../app/scripts/lib/hex-to-bn')
const {
conversionUtil,
multiplyCurrencies,
@ -20,7 +19,6 @@ const {
const { MIN_GAS_PRICE_HEX } = require('../send/send-constants')
const {
getSelectedTokenExchangeRate,
getTokenExchangeRate,
getSelectedAddress,
} = require('../../selectors')
@ -36,7 +34,6 @@ function mapStateToProps (state, ownProps) {
identities,
currentCurrency,
} = state.metamask
const accounts = state.metamask.accounts
const selectedAddress = getSelectedAddress(state)
const tokenExchangeRate = getTokenExchangeRate(state, symbol)
@ -245,7 +242,6 @@ ConfirmSendToken.prototype.renderTotalPlusGas = function () {
ConfirmSendToken.prototype.render = function () {
const { backToAccountDetail, selectedAddress } = this.props
const txMeta = this.gatherTxMeta()
const txParams = txMeta.txParams || {}
const {
from: {

@ -144,7 +144,6 @@ SendTokenScreen.prototype.validate = function () {
}
SendTokenScreen.prototype.setErrorsFor = function (field) {
const { balance, selectedToken } = this.props
const { errors: previousErrors } = this.state
const {

@ -1,7 +1,6 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const Identicon = require('../identicon')
const { conversionUtil, multiplyCurrencies } = require('../../conversion-util')
module.exports = CurrencyDisplay
@ -48,8 +47,6 @@ CurrencyDisplay.prototype.render = function () {
conversionRate,
primaryCurrency,
convertedCurrency,
convertedPrefix = '',
placeholder = '0',
readOnly = false,
inError = false,
value: initValue,

@ -1,7 +1,6 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const Identicon = require('../identicon')
const AccountListItem = require('./account-list-item')
module.exports = FromDropdown
@ -51,10 +50,8 @@ FromDropdown.prototype.renderDropdown = function () {
FromDropdown.prototype.render = function () {
const {
accounts,
selectedAccount,
openDropdown,
closeDropdown,
dropdownOpen,
} = this.props

@ -23,7 +23,7 @@ GasFeeDisplay.prototype.render = function () {
gasTotal
? h(CurrencyDisplay, {
primaryCurrency: 'ETH',
primaryCurrency,
convertedCurrency,
value: gasTotal,
conversionRate,

@ -1,33 +1,33 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const Identicon = require('../identicon')
module.exports = MemoTextArea
inherits(MemoTextArea, Component)
function MemoTextArea () {
Component.call(this)
}
MemoTextArea.prototype.render = function () {
const { memo, identities, onChange } = this.props
return h('div.send-v2__memo-text-area', [
h('textarea.send-v2__memo-text-area__input', {
placeholder: 'Optional',
value: memo,
onChange,
// onBlur: () => {
// this.setErrorsFor('memo')
// const Component = require('react').Component
// const h = require('react-hyperscript')
// const inherits = require('util').inherits
// const Identicon = require('../identicon')
// module.exports = MemoTextArea
// inherits(MemoTextArea, Component)
// function MemoTextArea () {
// Component.call(this)
// }
// MemoTextArea.prototype.render = function () {
// const { memo, identities, onChange } = this.props
// return h('div.send-v2__memo-text-area', [
// h('textarea.send-v2__memo-text-area__input', {
// placeholder: 'Optional',
// value: memo,
// onChange,
// // onBlur: () => {
// // this.setErrorsFor('memo')
// // },
// onFocus: event => {
// // this.clearErrorsFor('memo')
// },
onFocus: event => {
// this.clearErrorsFor('memo')
},
}),
// }),
])
// ])
}
// }

@ -1,5 +1,4 @@
const ethUtil = require('ethereumjs-util')
const Identicon = require('../identicon')
const { conversionUtil, multiplyCurrencies } = require('../../conversion-util')
const MIN_GAS_PRICE_HEX = (100000000).toString(16)

@ -27,7 +27,6 @@ function isBalanceSufficient({
fromNumericBase: 'hex',
conversionRate: amountConversionRate,
fromCurrency: selectedToken || primaryCurrency,
conversionRate: amountConversionRate,
},
)

@ -3,17 +3,12 @@ const actions = require('../../actions')
const abi = require('ethereumjs-abi')
const SendEther = require('../../send-v2')
const { multiplyCurrencies } = require('../../conversion-util')
const {
accountsWithSendEtherInfoSelector,
getCurrentAccountWithSendEtherInfo,
conversionRateSelector,
getSelectedToken,
getSelectedTokenExchangeRate,
getSelectedAddress,
getGasPrice,
getGasLimit,
getAddressBook,
getSendFrom,
getCurrentCurrency,
@ -26,7 +21,6 @@ function mapStateToProps (state) {
const fromAccounts = accountsWithSendEtherInfoSelector(state)
const selectedAddress = getSelectedAddress(state)
const selectedToken = getSelectedToken(state)
const tokenExchangeRates = state.metamask.tokenExchangeRates
const conversionRate = conversionRateSelector(state)
let data;

@ -1,7 +1,6 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const Identicon = require('../identicon')
const AccountListItem = require('./account-list-item')
module.exports = ToAutoComplete
@ -23,7 +22,6 @@ ToAutoComplete.prototype.getListItemIcon = function (listItemAddress, toAddress)
ToAutoComplete.prototype.renderDropdown = function () {
const {
accounts,
closeDropdown,
onChange,
to,
@ -86,9 +84,6 @@ ToAutoComplete.prototype.componentDidUpdate = function (nextProps, nextState) {
ToAutoComplete.prototype.render = function () {
const {
to,
accounts,
openDropdown,
closeDropdown,
dropdownOpen,
onChange,
inError,

@ -6,9 +6,7 @@ const connect = require('react-redux').connect
const ethUtil = require('ethereumjs-util')
const classnames = require('classnames')
const PendingTxDetails = require('./pending-personal-msg-details')
const AccountDropdownMini = require('./dropdowns/account-dropdown-mini')
const BinaryRenderer = require('./binary-renderer')
const actions = require('../actions')
const { conversionUtil } = require('../conversion-util')
@ -135,8 +133,6 @@ SignatureRequest.prototype.renderRequestIcon = function () {
}
SignatureRequest.prototype.renderRequestInfo = function () {
const { requester } = this.props
return h('div.request-signature__request-info', [
h('div.request-signature__headline', [
@ -206,7 +202,6 @@ SignatureRequest.prototype.renderBody = function () {
SignatureRequest.prototype.renderFooter = function () {
const {
goHome,
signPersonalMessage,
signTypedMessage,
cancelPersonalMessage,

@ -1,5 +1,6 @@
const { Component } = require('react')
const h = require('react-hyperscript')
const PropTypes = require('react').PropTypes
const classnames = require('classnames')
class TabBar extends Component {
@ -37,4 +38,10 @@ class TabBar extends Component {
}
}
TabBar.propTypes = {
defaultTab: PropTypes.string,
tabs: PropTypes.array,
tabSelected: PropTypes.func,
}
module.exports = TabBar

@ -3,7 +3,6 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const TokenTracker = require('eth-token-tracker')
const TokenCell = require('./token-cell.js')
const normalizeAddress = require('eth-sig-util').normalize
const connect = require('react-redux').connect
const selectors = require('../selectors')
@ -38,6 +37,7 @@ function TokenList () {
}
TokenList.prototype.render = function () {
const { userAddress } = this.props
const state = this.state
const { tokens, isLoading, error } = state
@ -162,15 +162,15 @@ TokenList.prototype.componentWillUnmount = function () {
this.tracker.stop()
}
function uniqueMergeTokens (tokensA, tokensB = []) {
const uniqueAddresses = []
const result = []
tokensA.concat(tokensB).forEach((token) => {
const normal = normalizeAddress(token.address)
if (!uniqueAddresses.includes(normal)) {
uniqueAddresses.push(normal)
result.push(token)
}
})
return result
}
// function uniqueMergeTokens (tokensA, tokensB = []) {
// const uniqueAddresses = []
// const result = []
// tokensA.concat(tokensB).forEach((token) => {
// const normal = normalizeAddress(token.address)
// if (!uniqueAddresses.includes(normal)) {
// uniqueAddresses.push(normal)
// result.push(token)
// }
// })
// return result
// }

@ -142,7 +142,7 @@ function formatDate (date) {
}
function renderErrorOrWarning (transaction) {
const { status, err, warning } = transaction
const { status } = transaction
// show rejected
if (status === 'rejected') {
@ -151,7 +151,6 @@ function renderErrorOrWarning (transaction) {
if (transaction.err || transaction.warning) {
const { err, warning = {} } = transaction
const errFirst = !!((err && warning) || err)
const message = errFirst ? err.message : warning.message
errFirst ? err.message : warning.message
@ -179,3 +178,4 @@ function renderErrorOrWarning (transaction) {
])
}
}
}

@ -6,7 +6,6 @@ const classnames = require('classnames')
const abi = require('human-standard-token-abi')
const abiDecoder = require('abi-decoder')
abiDecoder.addABI(abi)
const prefixForNetwork = require('../../lib/etherscan-prefix-for-network')
const Identicon = require('./identicon')
const contractMap = require('eth-contract-metadata')
@ -127,7 +126,6 @@ TxListItem.prototype.getTokenInfo = async function () {
TxListItem.prototype.getSendTokenTotal = async function () {
const {
txParams = {},
tokens,
conversionRate,
tokenExchangeRates,
currentCurrency,

@ -6,7 +6,7 @@ const prefixForNetwork = require('../../lib/etherscan-prefix-for-network')
const selectors = require('../selectors')
const TxListItem = require('./tx-list-item')
const ShiftListItem = require('./shift-list-item')
const { formatBalance, formatDate } = require('../util')
const { formatDate } = require('../util')
const { showConfTxPage } = require('../actions')
const classnames = require('classnames')
const { tokenInfoGetter } = require('../token-util')
@ -36,9 +36,6 @@ TxList.prototype.componentWillMount = function () {
}
TxList.prototype.render = function () {
const { txsToRender, showConfTxPage } = this.props
return h('div.flex-column.tx-list-container', {}, [
h('div.flex-row.tx-list-header-wrapper', [
@ -98,7 +95,6 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
txParams: transaction.txParams,
transactionStatus,
transActionId,
key: transActionId,
dateString,
address,
transactionAmount,

@ -114,7 +114,7 @@ ConfirmTxScreen.prototype.render = function () {
function currentTxView (opts) {
log.info('rendering current tx view')
const { txData } = opts
const { txParams, msgParams, type } = txData
const { txParams, msgParams } = txData
if (txParams) {
log.debug('txParams detected, rendering pending tx')

@ -22,6 +22,8 @@
*/
const BigNumber = require('bignumber.js')
const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN
const R = require('ramda')
const { stripHexPrefix } = require('ethereumjs-util')
@ -133,7 +135,7 @@ const addCurrencies = (a, b, options = {}) => {
const {
aBase,
bBase,
...conversionOptions,
...conversionOptions
} = options
const value = (new BigNumber(a, aBase)).add(b, bBase);
@ -147,7 +149,7 @@ const multiplyCurrencies = (a, b, options = {}) => {
const {
multiplicandBase,
multiplierBase,
...conversionOptions,
...conversionOptions
} = options
const bigNumberA = new BigNumber(String(a), multiplicandBase)
@ -157,7 +159,7 @@ const multiplyCurrencies = (a, b, options = {}) => {
return converter({
value,
...conversionOptions,
...conversionOptions
})
}

@ -1,8 +1,6 @@
const { inherits } = require('util')
const PersistentForm = require('../lib/persistent-form')
const h = require('react-hyperscript')
const connect = require('react-redux').connect
const classnames = require('classnames')
const Identicon = require('./components/identicon')
const FromDropdown = require('./components/send/from-dropdown')
@ -13,12 +11,9 @@ const GasFeeDisplay = require('./components/send/gas-fee-display-v2')
const { MIN_GAS_TOTAL } = require('./components/send/send-constants')
const { showModal } = require('./actions')
const {
multiplyCurrencies,
conversionGreaterThan,
addCurrencies,
} = require('./conversion-util')
const {
isBalanceSufficient,
@ -154,7 +149,6 @@ SendTransactionScreen.prototype.renderFromRow = function () {
from,
fromAccounts,
conversionRate,
setSelectedAddress,
updateSendFrom,
} = this.props
@ -243,7 +237,6 @@ SendTransactionScreen.prototype.validateAmount = function (value) {
amountConversionRate,
conversionRate,
primaryCurrency,
toCurrency,
selectedToken,
gasTotal,
} = this.props
@ -440,7 +433,6 @@ SendTransactionScreen.prototype.onSubmit = function (event) {
signTokenTx,
signTx,
selectedToken,
toAccounts,
clearSend,
errors: { amount: amountError, to: toError },
} = this.props

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save