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, searchQuery,
filterPulldown, filterPulldown,
filter, filter,
loadingChannelPubkeys, // loadingChannelPubkeys,
closingChannelIds // closingChannelIds
}, },
currentChannels, currentChannels,
balance, balance,
@ -73,7 +73,7 @@ class Network extends Component {
} }
const displayNodeName = (channel) => { 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 } if (node && node.alias.length) { return node.alias }
@ -88,12 +88,6 @@ class Network extends Component {
return 'online' return 'online'
} }
console.log('balance: ', balance)
console.log('currentTicker: ', currentTicker)
if (!currentTicker) { return <span /> }
if (balance.balanceLoading) { return <span /> }
return ( return (
<div className={styles.network}> <div className={styles.network}>
<header className={styles.header}> <header className={styles.header}>
@ -134,7 +128,7 @@ class Network extends Component {
'Refresh' 'Refresh'
} }
</span> </span>
</section> </section>
</header> </header>
<ul className={filterPulldown && styles.fade}> <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 export default Network

8
app/components/Wallet/Wallet.js

@ -1,6 +1,6 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import PropTypes from 'prop-types' 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 Isvg from 'react-inlinesvg'
import { btc } from 'utils' import { btc } from 'utils'
import bitcoinIcon from 'icons/bitcoin.svg' import bitcoinIcon from 'icons/bitcoin.svg'
@ -31,12 +31,6 @@ class Wallet extends Component {
openRequestForm openRequestForm
} = this.props } = 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 { modalOpen, qrCodeType } = this.state
const usdAmount = parseFloat(btc.satoshisToUsd(balance.walletBalance, currentTicker.price_usd)).toLocaleString() 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( const invoiceActivity = createSelector(
invoicesSelector, invoicesSelector,
invoices => invoices invoices => invoices
) )
const transactionActivity = createSelector(
transactionsSelector,
transactions => transactions
)
const sentActivity = createSelector( const sentActivity = createSelector(
transactionsSelector, transactionsSelector,
paymentsSelector, paymentsSelector,

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

@ -1,7 +1,5 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import PropTypes from 'prop-types' 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 Wallet from 'components/Wallet'
import LoadingBolt from 'components/LoadingBolt' import LoadingBolt from 'components/LoadingBolt'
@ -47,19 +45,16 @@ class Activity extends Component {
render() { render() {
const { const {
ticker, ticker,
updateSearchText,
invoice: { invoiceLoading }, invoice: { invoiceLoading },
address: { address }, address: { address },
balance, balance,
info, info,
payment: { paymentLoading }, payment: { paymentLoading },
currentTicker, currentTicker,
activity: { modal, filters, filter, filterPulldown, searchText }, activity: { modal, filters, filter, filterPulldown },
hideActivityModal, hideActivityModal,
changeFilter, changeFilter,
toggleFilterPulldown,
currentActivity, currentActivity,
nonActiveFilters,
newAddress, newAddress,
openPayForm, openPayForm,
openRequestForm openRequestForm
@ -127,7 +122,6 @@ Activity.propTypes = {
fetchBalance: PropTypes.func.isRequired, fetchBalance: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired, ticker: PropTypes.object.isRequired,
updateSearchText: PropTypes.func.isRequired,
invoice: PropTypes.object.isRequired, invoice: PropTypes.object.isRequired,
payment: PropTypes.object.isRequired, payment: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired, currentTicker: PropTypes.object.isRequired,
@ -136,13 +130,11 @@ Activity.propTypes = {
hideActivityModal: PropTypes.func.isRequired, hideActivityModal: PropTypes.func.isRequired,
changeFilter: PropTypes.func.isRequired, changeFilter: PropTypes.func.isRequired,
newAddress: PropTypes.func.isRequired, newAddress: PropTypes.func.isRequired,
toggleFilterPulldown: PropTypes.func.isRequired,
openPayForm: PropTypes.func.isRequired, openPayForm: PropTypes.func.isRequired,
openRequestForm: PropTypes.func.isRequired, openRequestForm: PropTypes.func.isRequired,
activity: PropTypes.object.isRequired, activity: PropTypes.object.isRequired,
currentActivity: PropTypes.array.isRequired, currentActivity: PropTypes.array.isRequired,
nonActiveFilters: PropTypes.array.isRequired,
address: PropTypes.object.isRequired, address: PropTypes.object.isRequired,
balance: PropTypes.object.isRequired, balance: PropTypes.object.isRequired,
info: 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 from 'react-moment'
import 'moment-timezone' import 'moment-timezone'
import Isvg from 'react-inlinesvg' 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 { btc } from 'utils'
import checkmarkIcon from 'icons/check_circle.svg' import checkmarkIcon from 'icons/check_circle.svg'
import clockIcon from 'icons/clock.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) nonActiveFilters: activitySelectors.nonActiveFilters(state)
}) })
const mergeProps = (stateProps, dispatchProps, ownProps) => { const mergeProps = (stateProps, dispatchProps, ownProps) => ({
return { return {
...stateProps, ...stateProps,
...dispatchProps, ...dispatchProps,
@ -73,8 +73,8 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
// action to open the pay form // action to open the pay form
openPayForm: () => dispatchProps.setFormType('PAY_FORM'), openPayForm: () => dispatchProps.setFormType('PAY_FORM'),
// action to open the request form // action to open the request form
openRequestForm: () => dispatchProps.setFormType('REQUEST_FORM'), openRequestForm: () => dispatchProps.setFormType('REQUEST_FORM')
} }
} })
export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(Activity) export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(Activity)

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

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

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

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

Loading…
Cancel
Save