Browse Source

fix(lint): fix linting errors

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
03f5e22f68
  1. 2
      app/components/Channels/Channel.js
  2. 3
      app/components/CryptoIcon/CryptoIcon.js
  3. 1
      app/components/LoadingBolt/LoadingBolt.js
  4. 1
      app/components/Nav/Nav.js
  5. 4
      app/components/Wallet/Wallet.js
  6. 53
      app/reducers/channels.js
  7. 9
      app/routes/channels/components/Channels.js
  8. 27
      app/routes/wallet/components/Wallet.js

2
app/components/Channels/Channel.js

@ -5,7 +5,7 @@ import { btc } from 'utils'
import styles from './Channel.scss'
const Channel = ({ ticker, channel, closeChannel, currentTicker }) => (
<li className={styles.channel} onClick={() => setChannel(channel)}>
<li className={styles.channel}>
<header className={styles.header}>
<div>
<span className={styles.status}>Open</span>

3
app/components/CryptoIcon/CryptoIcon.js

@ -1,10 +1,9 @@
import React from 'react'
import PropTypes from 'prop-types'
import path from 'path'
import Isvg from 'react-inlinesvg'
import skinnyBitcoinIcon from 'icons/skinny_bitcoin.svg'
import litecoinIcon from 'icons/skinny_bitcoin.svg'
import litecoinIcon from 'icons/litecoin.svg'
const CryptoIcon = ({ currency, styles }) => {
switch (currency) {

1
app/components/LoadingBolt/LoadingBolt.js

@ -1,5 +1,4 @@
import React from 'react'
import path from 'path'
import Isvg from 'react-inlinesvg'
import cloudboltIcon from 'icons/cloudbolt.svg'

1
app/components/Nav/Nav.js

@ -1,4 +1,3 @@
import path from 'path'
import React from 'react'
import PropTypes from 'prop-types'
import { NavLink } from 'react-router-dom'

4
app/components/Wallet/Wallet.js

@ -1,12 +1,10 @@
import path from 'path'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { FaQrcode } from 'react-icons/lib/fa'
import Isvg from 'react-inlinesvg'
import { btc } from 'utils'
import ReceiveModal from './ReceiveModal'
import skinnyBitcoinIcon from 'icons/skinny_bitcoin.svg'
import ReceiveModal from './ReceiveModal'
import styles from './Wallet.scss'

53
app/reducers/channels.js

@ -121,7 +121,7 @@ export const pushchannelupdated = () => (dispatch) => {
}
// Receive IPC event for channel end
export const pushchannelend = event => (dispatch) => {
export const pushchannelend = event => (dispatch) => { // eslint-disable-line
dispatch(fetchChannels())
}
@ -132,7 +132,7 @@ export const pushchannelerror = (event, { error }) => (dispatch) => {
}
// Receive IPC event for channel status
export const pushchannelstatus = event => (dispatch) => {
export const pushchannelstatus = event => (dispatch) => { // eslint-disable-line
dispatch(fetchChannels())
}
@ -284,32 +284,31 @@ export const currentChannels = createSelector(
closingPendingChannels,
filterSelector,
channelSearchQuerySelector,
(allChannels, activeChannels, openChannels, pendingOpenChannels, pendingClosedChannels, filter, searchQuery) => {
(allChannelsArr, activeChannelsArr, openChannels, pendingOpenChannels, pendingClosedChannels, filter, searchQuery) => {
// Helper function to deliver correct channel array based on filter
const filteredArray = filter => {
switch(filter) {
const filteredArray = (filterKey) => {
switch (filterKey) {
case 'ALL_CHANNELS':
return allChannels
return allChannelsArr
case 'ACTIVE_CHANNELS':
return activeChannels
return activeChannelsArr
case 'OPEN_CHANNELS':
return openChannels
case 'OPEN_PENDING_CHANNELS':
return pendingOpenChannels
case 'CLOSING_PENDING_CHANNELS':
return pendingClosedChannels
default:
return []
}
}
const channelArray = filteredArray(filter.key)
console.log('channelArray: ', channelArray)
return channelArray.filter(channel => {
return Object.prototype.hasOwnProperty.call(channel, 'channel') ?
channel.channel.remote_node_pub.includes(searchQuery) || channel.channel.channel_point.includes(searchQuery)
:
channel.remote_pubkey.includes(searchQuery) || channel.channel_point.includes(searchQuery)
})
return channelArray.filter(channel => (Object.prototype.hasOwnProperty.call(channel, 'channel') ?
channel.channel.remote_node_pub.includes(searchQuery) || channel.channel.channel_point.includes(searchQuery)
:
channel.remote_pubkey.includes(searchQuery) || channel.channel_point.includes(searchQuery)))
}
)
@ -325,18 +324,18 @@ const initialState = {
total_limbo_balance: '',
pending_open_channels: [
{
"channel": {
"remote_node_pub": "0368b02d9e4a44bb156660cf48ed7492445c7cb95435c86125e74953047c7706e3",
"channel_point": "01de1cddaf47637b71c37e019f42746aa1135351a4e4539d983ca95f12049a82:0",
"capacity": "16777216",
"local_balance": "16768528",
"remote_balance": "0"
channel: {
remote_node_pub: '0368b02d9e4a44bb156660cf48ed7492445c7cb95435c86125e74953047c7706e3',
channel_point: '01de1cddaf47637b71c37e019f42746aa1135351a4e4539d983ca95f12049a82:0',
capacity: '16777216',
local_balance: '16768528',
remote_balance: '0'
},
"confirmation_height": 0,
"blocks_till_open": 0,
"commit_fee": "8688",
"commit_weight": "600",
"fee_per_kw": "12000"
confirmation_height: 0,
blocks_till_open: 0,
commit_fee: '8688',
commit_weight: '600',
fee_per_kw: '12000'
}
],
pending_closing_channels: [],
@ -361,8 +360,8 @@ const initialState = {
{ key: 'ACTIVE_CHANNELS', name: 'Active Channels' },
{ key: 'OPEN_CHANNELS', name: 'Open Channels' },
{ key: 'OPEN_PENDING_CHANNELS', name: 'Open Pending Channels' },
{ key: 'CLOSING_PENDING_CHANNELS', name: 'Closing Pending Channels' },
],
{ key: 'CLOSING_PENDING_CHANNELS', name: 'Closing Pending Channels' }
]
}
export default function channelsReducer(state = initialState, action) {

9
app/routes/channels/components/Channels.js

@ -36,7 +36,6 @@ class Channels extends Component {
toggleFilterPulldown,
changeFilter,
allChannels,
currentChannels,
openChannels,
updateChannelSearchQuery,
@ -68,8 +67,6 @@ class Channels extends Component {
icon.style.animation = 'spin 1000ms linear 1'
}
console.log('currentChannels: ',currentChannels)
return (
<div className={`${styles.container} ${viewType === 1 && styles.graphview}`}>
<ChannelForm {...channelFormProps} />
@ -185,18 +182,22 @@ Channels.propTypes = {
fetchPeers: PropTypes.func.isRequired,
channels: PropTypes.object.isRequired,
allChannels: PropTypes.array.isRequired,
currentChannels: PropTypes.array.isRequired,
openChannels: PropTypes.array.isRequired,
updateChannelSearchQuery: PropTypes.func.isRequired,
setViewType: PropTypes.func.isRequired,
setCurrentChannel: PropTypes.func.isRequired,
openChannelForm: PropTypes.func.isRequired,
closeChannel: PropTypes.func.isRequired,
toggleFilterPulldown: PropTypes.func.isRequired,
changeFilter: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired,
channelFormProps: PropTypes.object.isRequired,
nonActiveFilters: PropTypes.object.isRequired,
network: PropTypes.object.isRequired,
fetchDescribeNetwork: PropTypes.func.isRequired,

27
app/routes/wallet/components/Wallet.js

@ -5,31 +5,20 @@ import styles from './Wallet.scss'
class Wallet extends Component {
componentWillMount() {
const { fetchPeers, fetchChannels } = this.props
const { fetchPeers } = this.props
fetchPeers()
fetchChannels()
}
render() {
const {
ticker,
peers: { peersLoading, peers, peer, peerForm },
channels: { channelsLoading, channels, channel, channelForm, pendingChannels },
fetchPeers,
fetchChannels,
setPeer,
setChannel,
peerModalOpen,
channelModalOpen,
setPeerForm,
setChannelForm,
connectRequest,
disconnectRequest,
openChannel,
closeChannel,
currentTicker,
explorerLinkBase
disconnectRequest
} = this.props
return (
@ -55,22 +44,12 @@ class Wallet extends Component {
Wallet.propTypes = {
fetchPeers: PropTypes.func.isRequired,
fetchChannels: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired,
peers: PropTypes.object.isRequired,
channels: PropTypes.object.isRequired,
setPeer: PropTypes.func.isRequired,
setChannel: PropTypes.func.isRequired,
peerModalOpen: PropTypes.bool.isRequired,
channelModalOpen: PropTypes.bool.isRequired,
setPeerForm: PropTypes.func.isRequired,
setChannelForm: PropTypes.func.isRequired,
connectRequest: PropTypes.func.isRequired,
disconnectRequest: PropTypes.func.isRequired,
openChannel: PropTypes.func.isRequired,
closeChannel: PropTypes.func.isRequired,
currentTicker: PropTypes.object.isRequired,
explorerLinkBase: PropTypes.string.isRequired
disconnectRequest: PropTypes.func.isRequired
}

Loading…
Cancel
Save