Browse Source

fix(lint): fix linting errors

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
3d9ee73d02
  1. 16
      app/components/ChannelForm/ChannelForm.js
  2. 3
      app/components/ChannelForm/Footer.js
  3. 55
      app/components/ChannelForm/StepFour.js
  4. 8
      app/components/ChannelForm/StepOne.js
  5. 17
      app/components/ChannelForm/StepThree.js
  6. 17
      app/components/ChannelForm/StepTwo.js
  7. 5
      app/components/Channels/CardChannel.js
  8. 1
      app/components/CryptoIcon/CryptoIcon.js
  9. 2
      app/reducers/channelform.js
  10. 57
      app/routes/channels/components/Channels.js
  11. BIN
      resources/bin/linux/lnd
  12. BIN
      resources/bin/win32/lnd.exe
  13. 3
      test/components/Nav.spec.js

16
app/components/ChannelForm/ChannelForm.js

@ -56,7 +56,7 @@ const ChannelForm = ({
<header className={styles.header}>
<h3>{channelFormHeader}</h3>
<div className={styles.progress} style={{ width: `${channelFormProgress}%` }}></div>
<div className={styles.progress} style={{ width: `${channelFormProgress}%` }} />
</header>
<div className={styles.content}>
@ -73,6 +73,18 @@ const ChannelForm = ({
)
}
ChannelForm.propTypes = {}
ChannelForm.propTypes = {
channelform: PropTypes.object.isRequired,
openChannel: PropTypes.func.isRequired,
closeChannelForm: PropTypes.func.isRequired,
changeStep: PropTypes.func.isRequired,
setNodeKey: PropTypes.func.isRequired,
setLocalAmount: PropTypes.func.isRequired,
setPushAmount: PropTypes.func.isRequired,
channelFormHeader: PropTypes.string.isRequired,
channelFormProgress: PropTypes.number.isRequired,
stepTwoIsValid: PropTypes.bool.isRequired,
peers: PropTypes.array.isRequired
}
export default ChannelForm

3
app/components/ChannelForm/Footer.js

@ -1,10 +1,9 @@
import React from 'react'
import PropTypes from 'prop-types'
import { FaArrowLeft, FaArrowRight, FaCheck } from 'react-icons/lib/fa'
import styles from './Footer.scss'
const Footer = ({ step, changeStep, stepTwoIsValid, submit }) => {
if ( step === 1 ) { return null }
if (step === 1) { return null }
// See if the next button on step 2 should be active
const nextIsInactive = step === 2 && !stepTwoIsValid

55
app/components/ChannelForm/StepFour.js

@ -1,34 +1,37 @@
import React, { Component } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import CurrencyIcon from 'components/CurrencyIcon'
import styles from './StepFour.scss'
class StepFour extends Component {
render() {
const { node_key, local_amt, push_amt } = this.props
const StepFour = ({ node_key, local_amt, push_amt }) => (
<div className={styles.container}>
<div className={styles.nodekey}>
<h4>Peer</h4>
<h2>{node_key}</h2>
</div>
return (
<div className={styles.container}>
<div className={styles.nodekey}>
<h4>Peer</h4>
<h2>{node_key}</h2>
</div>
<div className={styles.amounts}>
<div className={styles.localamt}>
<h4>Local Amount</h4>
<h3>{local_amt}</h3>
</div>
<div className={styles.pushamt}>
<h4>Push Amount</h4>
<h3>{push_amt}</h3>
</div>
</div>
<div className={styles.amounts}>
<div className={styles.localamt}>
<h4>Local Amount</h4>
<h3>{local_amt}</h3>
</div>
)
}
}
<div className={styles.pushamt}>
<h4>Push Amount</h4>
<h3>{push_amt}</h3>
</div>
</div>
</div>
)
StepFour.propTypes = {}
StepFour.propTypes = {
node_key: PropTypes.string.isRequired,
local_amt: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
]),
push_amt: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
])
}
export default StepFour

8
app/components/ChannelForm/StepOne.js

@ -59,13 +59,17 @@ class StepOne extends Component {
<h1>{peer.pub_key}</h1>
</li>
)
)}
)}
</ul>
</div>
)
}
}
StepOne.propTypes = {}
StepOne.propTypes = {
peers: PropTypes.array.isRequired,
setNodeKey: PropTypes.func.isRequired,
changeStep: PropTypes.func.isRequired
}
export default StepOne

17
app/components/ChannelForm/StepThree.js

@ -11,7 +11,11 @@ class StepThree extends Component {
<div className={styles.container}>
<div className={styles.explainer}>
<h2>Push Amount</h2>
<p>The push amount is the amount of bitcoin (if any at all) you'd like to "push" to the other side of the channel when it opens. This amount will be set on the remote side of the channel as part of the initial commitment state.</p>
<p>
The push amount is the amount of bitcoin (if any at all) you&apos;d like
to &quot;push&quot; to the other side of the channel when it opens.
This amount will be set on the remote side of the channel as part of the initial commitment state.
</p>
</div>
<form>
@ -19,11 +23,10 @@ class StepThree extends Component {
<CurrencyIcon currency={'btc'} crypto={'btc'} />
</label>
<input
autoFocus
type='number'
min='0'
max='0.16'
ref={input => this.input = input}
ref={input => (this.input = input)}
size=''
value={push_amt}
onChange={event => setPushAmount(event.target.value)}
@ -36,6 +39,12 @@ class StepThree extends Component {
}
}
StepThree.propTypes = {}
StepThree.propTypes = {
push_amt: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
]).isRequired,
setPushAmount: PropTypes.func.isRequired
}
export default StepThree

17
app/components/ChannelForm/StepTwo.js

@ -1,6 +1,5 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import AutosizeInput from 'react-input-autosize'
import CurrencyIcon from 'components/CurrencyIcon'
import styles from './StepTwo.scss'
@ -12,7 +11,10 @@ class StepTwo extends Component {
<div className={styles.container}>
<div className={styles.explainer}>
<h2>Local Amount</h2>
<p>Local amount is the amount of bitcoin that you would like to commit to the channel. This is the amount that will be sent in an on-chain transaction to open your Lightning channel.</p>
<p>
Local amount is the amount of bitcoin that you would like to commit to the channel.
This is the amount that will be sent in an on-chain transaction to open your Lightning channel.
</p>
</div>
<form>
@ -20,11 +22,10 @@ class StepTwo extends Component {
<CurrencyIcon currency={'btc'} crypto={'btc'} />
</label>
<input
autoFocus
type='number'
min='0'
max='0.16'
ref={input => this.input = input}
ref={input => (this.input = input)}
size=''
value={local_amt}
onChange={event => setLocalAmount(event.target.value)}
@ -37,6 +38,12 @@ class StepTwo extends Component {
}
}
StepTwo.propTypes = {}
StepTwo.propTypes = {
local_amt: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]).isRequired,
setLocalAmount: PropTypes.func.isRequired
}
export default StepTwo

5
app/components/Channels/CardChannel.js

@ -1,16 +1,15 @@
import React from 'react'
import PropTypes from 'prop-types'
import { btc } from 'utils'
import styles from './CardChannel.scss'
const CardChannel = ({ channel }) => (
<li className={styles.channel}>
CardChannel
{channel.chan_id}
</li>
)
CardChannel.propTypes = {
channel: PropTypes.object.isRequired
}
export default CardChannel

1
app/components/CryptoIcon/CryptoIcon.js

@ -1,7 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
import path from 'path'
import { FaBitcoin } from 'react-icons/lib/fa'
import Isvg from 'react-inlinesvg'
const CryptoIcon = ({ currency, styles }) => {

2
app/reducers/channelform.js

@ -94,7 +94,7 @@ const channelFormLocalAmountSelector = state => state.channelform.local_amt
channelFormSelectors.channelFormHeader = createSelector(
channelFormStepSelector,
step => {
(step) => {
switch (step) {
case 1:
return 'Step 1: Select a peer'

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

@ -20,18 +20,12 @@ class Channels extends Component {
render() {
const {
channels: { channels, searchQuery, viewType },
channels: { searchQuery, viewType },
allChannels,
updateChannelSearchQuery,
setViewType,
closeChannelForm,
openChannelForm,
channelform,
channelFormHeader,
channelFormProgress,
peers: { peers },
ticker,
currentTicker,
@ -61,7 +55,7 @@ class Channels extends Component {
<span className={viewType === 0 && styles.active} onClick={() => setViewType(0)}>
<FaAlignJustify />
</span>
<span className={viewType === 1 && styles.active} onClick={() => setViewType(1)}>
<span className={viewType === 1 && styles.active}>
<FaThLarge />
</span>
</div>
@ -74,26 +68,22 @@ class Channels extends Component {
<div className={styles.channels}>
<ul className={viewType === 1 && styles.cardsContainer}>
{ viewType === 0 && allChannels.map((channel, index) => {
return (
<Channel
key={index}
ticker={ticker}
channel={channel}
setChannel={() => console.log('hi')}
currentTicker={currentTicker}
/>
)
})
}
{ viewType === 1 && allChannels.map((channel, index) => {
return (
<CardChannel key={index}>
{ viewType === 0 && allChannels.map((channel, index) => (
<Channel
key={index}
ticker={ticker}
channel={channel}
setChannel={() => console.log('hi')}
currentTicker={currentTicker}
/>
))
}
{ viewType === 1 && allChannels.map((channel, index) => (
<CardChannel key={index} channel={channel}>
card channel
</CardChannel>
)
})
}
</CardChannel>
))
}
</ul>
</div>
</div>
@ -102,7 +92,20 @@ class Channels extends Component {
}
Channels.propTypes = {
fetchChannels: PropTypes.func.isRequired,
fetchPeers: PropTypes.func.isRequired,
channels: PropTypes.object.isRequired,
allChannels: PropTypes.array.isRequired,
updateChannelSearchQuery: PropTypes.func.isRequired,
setViewType: PropTypes.func.isRequired,
openChannelForm: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired,
channelFormProps: PropTypes.object.isRequired
}
export default Channels

BIN
resources/bin/linux/lnd

Binary file not shown.

BIN
resources/bin/win32/lnd.exe

Binary file not shown.

3
test/components/Nav.spec.js

@ -1,9 +1,6 @@
import React from 'react'
import { shallow } from 'enzyme'
import ReactSVG from 'react-svg'
import { NavLink } from 'react-router-dom'
import { MdAccountBalanceWallet } from 'react-icons/lib/md'
import { FaClockO, FaDollar } from 'react-icons/lib/fa'
import Nav from 'components/Nav'
const defaultProps = {

Loading…
Cancel
Save