Browse Source

fix(lint): fix linting errors

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
12677e7f2c
  1. 31
      app/components/Contacts/Network.js
  2. 8
      app/components/Wallet/Wallet.js
  3. 16
      app/reducers/activity.js
  4. 10
      app/routes/activity/components/Activity.js
  5. 2
      app/routes/activity/components/components/Invoice/Invoice.js
  6. 6
      app/routes/activity/containers/ActivityContainer.js
  7. 14
      app/routes/app/components/App.js
  8. 6
      app/routes/app/containers/AppContainer.js

31
app/components/Contacts/Network.js

@ -23,8 +23,8 @@ class Network extends Component {
searchQuery,
filterPulldown,
filter,
loadingChannelPubkeys,
closingChannelIds
// loadingChannelPubkeys,
// closingChannelIds
},
currentChannels,
balance,
@ -73,7 +73,7 @@ class Network extends Component {
}
const displayNodeName = (channel) => {
const node = find(nodes, node => channel.remote_pubkey === node.pub_key)
const node = find(nodes, n => channel.remote_pubkey === n.pub_key)
if (node && node.alias.length) { return node.alias }
@ -88,12 +88,6 @@ class Network extends Component {
return 'online'
}
console.log('balance: ', balance)
console.log('currentTicker: ', currentTicker)
if (!currentTicker) { return <span /> }
if (balance.balanceLoading) { return <span /> }
return (
<div className={styles.network}>
<header className={styles.header}>
@ -134,7 +128,7 @@ class Network extends Component {
'Refresh'
}
</span>
</section>
</section>
</header>
<ul className={filterPulldown && styles.fade}>
@ -170,6 +164,21 @@ class Network extends Component {
}
}
Network.propTypes = {}
Network.propTypes = {
channels: PropTypes.array.isRequired,
currentChannels: PropTypes.array.isRequired,
nodes: PropTypes.array.isRequired,
nonActiveFilters: PropTypes.array.isRequired,
balance: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired,
fetchChannels: PropTypes.func.isRequired,
openContactsForm: PropTypes.func.isRequired,
toggleFilterPulldown: PropTypes.func.isRequired,
changeFilter: PropTypes.func.isRequired,
updateChannelSearchQuery: PropTypes.func.isRequired,
openContactModal: PropTypes.func.isRequired,
}
export default Network

8
app/components/Wallet/Wallet.js

@ -1,6 +1,6 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { FaQrcode, FaAngleDown } from 'react-icons/lib/fa'
import { FaAngleDown } from 'react-icons/lib/fa'
import Isvg from 'react-inlinesvg'
import { btc } from 'utils'
import bitcoinIcon from 'icons/bitcoin.svg'
@ -31,12 +31,6 @@ class Wallet extends Component {
openRequestForm
} = this.props
console.log('balance: ', balance)
console.log('currentTicker: ', currentTicker)
if (!currentTicker) { return <span /> }
if (balance.balanceLoading) { return <span /> }
const { modalOpen, qrCodeType } = this.state
const usdAmount = parseFloat(btc.satoshisToUsd(balance.walletBalance, currentTicker.price_usd)).toLocaleString()

16
app/reducers/activity.js

@ -118,27 +118,11 @@ const allActivity = createSelector(
}
)
const lnActivity = createSelector(
paymentsSelector,
invoicesSelector,
(payments, invoices) => [...payments, ...invoices].sort((a, b) => b.creation_date - a.creation_date)
)
const paymentActivity = createSelector(
paymentsSelector,
payments => payments
)
const invoiceActivity = createSelector(
invoicesSelector,
invoices => invoices
)
const transactionActivity = createSelector(
transactionsSelector,
transactions => transactions
)
const sentActivity = createSelector(
transactionsSelector,
paymentsSelector,

10
app/routes/activity/components/Activity.js

@ -1,7 +1,5 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { MdSearch } from 'react-icons/lib/md'
import { FaAngleDown } from 'react-icons/lib/fa'
import Wallet from 'components/Wallet'
import LoadingBolt from 'components/LoadingBolt'
@ -47,19 +45,16 @@ class Activity extends Component {
render() {
const {
ticker,
updateSearchText,
invoice: { invoiceLoading },
address: { address },
balance,
info,
payment: { paymentLoading },
currentTicker,
activity: { modal, filters, filter, filterPulldown, searchText },
activity: { modal, filters, filter, filterPulldown },
hideActivityModal,
changeFilter,
toggleFilterPulldown,
currentActivity,
nonActiveFilters,
newAddress,
openPayForm,
openRequestForm
@ -127,7 +122,6 @@ Activity.propTypes = {
fetchBalance: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired,
updateSearchText: PropTypes.func.isRequired,
invoice: PropTypes.object.isRequired,
payment: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired,
@ -136,13 +130,11 @@ Activity.propTypes = {
hideActivityModal: PropTypes.func.isRequired,
changeFilter: PropTypes.func.isRequired,
newAddress: PropTypes.func.isRequired,
toggleFilterPulldown: PropTypes.func.isRequired,
openPayForm: PropTypes.func.isRequired,
openRequestForm: PropTypes.func.isRequired,
activity: PropTypes.object.isRequired,
currentActivity: PropTypes.array.isRequired,
nonActiveFilters: PropTypes.array.isRequired,
address: PropTypes.object.isRequired,
balance: PropTypes.object.isRequired,
info: PropTypes.object.isRequired

2
app/routes/activity/components/components/Invoice/Invoice.js

@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import Moment from 'react-moment'
import 'moment-timezone'
import Isvg from 'react-inlinesvg'
import { FaBolt, FaClockO } from 'react-icons/lib/fa'
import { FaBolt } from 'react-icons/lib/fa'
import { btc } from 'utils'
import checkmarkIcon from 'icons/check_circle.svg'
import clockIcon from 'icons/clock.svg'

6
app/routes/activity/containers/ActivityContainer.js

@ -64,7 +64,7 @@ const mapStateToProps = state => ({
nonActiveFilters: activitySelectors.nonActiveFilters(state)
})
const mergeProps = (stateProps, dispatchProps, ownProps) => {
const mergeProps = (stateProps, dispatchProps, ownProps) => ({
return {
...stateProps,
...dispatchProps,
@ -73,8 +73,8 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
// action to open the pay form
openPayForm: () => dispatchProps.setFormType('PAY_FORM'),
// action to open the request form
openRequestForm: () => dispatchProps.setFormType('REQUEST_FORM'),
openRequestForm: () => dispatchProps.setFormType('REQUEST_FORM')
}
}
})
export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(Activity)

14
app/routes/app/components/App.js

@ -39,9 +39,6 @@ class App extends Component {
currentTicker,
form,
channels,
balance,
formProps,
closeForm,
@ -77,7 +74,7 @@ class App extends Component {
<div className={styles.content}>
{children}
</div>
<Network {...networkTabProps} />
</div>
)
@ -91,14 +88,21 @@ App.propTypes = {
formProps: PropTypes.object.isRequired,
closeForm: PropTypes.func.isRequired,
error: PropTypes.object.isRequired,
currentTicker: PropTypes.object,
contactModalProps: PropTypes.object,
contactsFormProps: PropTypes.object,
networkTabProps: PropTypes.object,
newAddress: PropTypes.func.isRequired,
fetchInfo: PropTypes.func.isRequired,
hideModal: PropTypes.func.isRequired,
fetchTicker: PropTypes.func.isRequired,
clearError: PropTypes.func.isRequired,
fetchChannels: PropTypes.func.isRequired,
fetchBalance: PropTypes.func.isRequired,
fetchDescribeNetwork: PropTypes.func.isRequired,
currentTicker: PropTypes.object,
children: PropTypes.object.isRequired
}

6
app/routes/app/containers/AppContainer.js

@ -57,7 +57,7 @@ import App from '../components/App'
const mapDispatchToProps = {
fetchTicker,
setCurrency,
newAddress,
fetchInfo,
@ -93,7 +93,7 @@ const mapDispatchToProps = {
updateChannelSearchQuery,
openContactModal,
closeContactModal,
openContactsForm,
closeContactsForm,
updateContactFormSearchQuery,
@ -243,7 +243,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
return {}
}
const networkTabProps = {
const networkTabProps = {
currentChannels: stateProps.currentChannels,
channels: stateProps.channels,
balance: stateProps.balance,

Loading…
Cancel
Save