Browse Source

style(lint): fix issues from rule react/destructuring-assignment

renovate/lint-staged-8.x
Tom Kirkpatrick 7 years ago
parent
commit
18ea5d3b45
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 9
      app/components/Activity/Countdown.js
  2. 4
      app/components/Contacts/Network.js
  3. 5
      app/components/GlobalError/GlobalError.js
  4. 3
      app/components/Onboarding/ReEnterSeed.js
  5. 3
      app/components/Wallet/ReceiveModal.js

9
app/components/Activity/Countdown.js

@ -26,20 +26,23 @@ class Countdown extends React.Component {
}
componentWillUnmount() {
const { interval } = this.state
// use interval from the state to clear the interval
clearInterval(this.state.interval)
clearInterval(interval)
}
timerInterval() {
const convertTwoDigits = n => (n > 9 ? n : `0${n}`.slice(-2))
const now = new Date().getTime()
const countDownSeconds = this.props.countDownDate * 1000
const { countDownDate } = this.props
const countDownSeconds = countDownDate * 1000
const distance = countDownSeconds - now
if (distance <= 0) {
this.setState({ expired: true })
clearInterval(this.state.interval)
const { interval } = this.state
clearInterval(interval)
return
}

4
app/components/Contacts/Network.js

@ -149,7 +149,7 @@ class Network extends Component {
}
const usdAmount = btc.satoshisToUsd(balance.channelBalance, currentTicker.price_usd)
const { refreshing } = this.state
return (
<div className={styles.network}>
<header className={styles.header}>
@ -202,7 +202,7 @@ class Network extends Component {
this.repeat = ref
}}
>
{this.state.refreshing ? <FaRepeat /> : 'Refresh'}
{refreshing ? <FaRepeat /> : 'Refresh'}
</span>
</section>
</header>

5
app/components/GlobalError/GlobalError.js

@ -5,8 +5,9 @@ import styles from './GlobalError.scss'
class GlobalError extends React.Component {
componentDidUpdate(prevProps) {
if (!prevProps.error && this.props.error) {
setTimeout(this.props.clearError, 10000)
const { clearError, error } = this.props
if (!prevProps.error && error) {
setTimeout(clearError, 10000)
}
}

3
app/components/Onboarding/ReEnterSeed.js

@ -4,7 +4,8 @@ import styles from './ReEnterSeed.scss'
class ReEnterSeed extends React.Component {
componentWillMount() {
this.props.setReEnterSeedIndexes()
const { setReEnterSeedIndexes } = this.props
setReEnterSeedIndexes()
}
render() {

3
app/components/Wallet/ReceiveModal.js

@ -26,7 +26,8 @@ class ReceiveModal extends React.Component {
}
const changeQrCode = () => {
if (this.state.qrCodeType === 1) {
const { qrCodeType } = this.state
if (qrCodeType === 1) {
this.setState({ qrCodeType: 2 })
} else {
this.setState({ qrCodeType: 1 })

Loading…
Cancel
Save