From 12677e7f2c8d8cc0ce9000f834d8772d974d38ed Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Thu, 8 Feb 2018 09:40:19 -0600 Subject: [PATCH] fix(lint): fix linting errors --- app/components/Contacts/Network.js | 31 ++++++++++++------- app/components/Wallet/Wallet.js | 8 +---- app/reducers/activity.js | 16 ---------- app/routes/activity/components/Activity.js | 10 +----- .../components/components/Invoice/Invoice.js | 2 +- .../activity/containers/ActivityContainer.js | 6 ++-- app/routes/app/components/App.js | 14 ++++++--- app/routes/app/containers/AppContainer.js | 6 ++-- 8 files changed, 38 insertions(+), 55 deletions(-) diff --git a/app/components/Contacts/Network.js b/app/components/Contacts/Network.js index 33a47ba8..33c5156d 100644 --- a/app/components/Contacts/Network.js +++ b/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 } - if (balance.balanceLoading) { return } - return (
@@ -134,7 +128,7 @@ class Network extends Component { 'Refresh' } - +
    @@ -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 diff --git a/app/components/Wallet/Wallet.js b/app/components/Wallet/Wallet.js index 70ca76a8..cabaa401 100644 --- a/app/components/Wallet/Wallet.js +++ b/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 } - if (balance.balanceLoading) { return } - const { modalOpen, qrCodeType } = this.state const usdAmount = parseFloat(btc.satoshisToUsd(balance.walletBalance, currentTicker.price_usd)).toLocaleString() diff --git a/app/reducers/activity.js b/app/reducers/activity.js index 64b3e61c..e08ff65e 100644 --- a/app/reducers/activity.js +++ b/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, diff --git a/app/routes/activity/components/Activity.js b/app/routes/activity/components/Activity.js index f616e63f..726721b8 100644 --- a/app/routes/activity/components/Activity.js +++ b/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 diff --git a/app/routes/activity/components/components/Invoice/Invoice.js b/app/routes/activity/components/components/Invoice/Invoice.js index ea5c4f5a..b5e64634 100644 --- a/app/routes/activity/components/components/Invoice/Invoice.js +++ b/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' diff --git a/app/routes/activity/containers/ActivityContainer.js b/app/routes/activity/containers/ActivityContainer.js index 7909bd10..88aa4fba 100644 --- a/app/routes/activity/containers/ActivityContainer.js +++ b/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) diff --git a/app/routes/app/components/App.js b/app/routes/app/components/App.js index ba8190d8..dc5c070c 100644 --- a/app/routes/app/components/App.js +++ b/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 {
    {children}
    - +
) @@ -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 } diff --git a/app/routes/app/containers/AppContainer.js b/app/routes/app/containers/AppContainer.js index 2d9f0efa..b1e4ab65 100644 --- a/app/routes/app/containers/AppContainer.js +++ b/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,