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() { componentWillUnmount() {
const { interval } = this.state
// use interval from the state to clear the interval // use interval from the state to clear the interval
clearInterval(this.state.interval) clearInterval(interval)
} }
timerInterval() { timerInterval() {
const convertTwoDigits = n => (n > 9 ? n : `0${n}`.slice(-2)) const convertTwoDigits = n => (n > 9 ? n : `0${n}`.slice(-2))
const now = new Date().getTime() const now = new Date().getTime()
const countDownSeconds = this.props.countDownDate * 1000 const { countDownDate } = this.props
const countDownSeconds = countDownDate * 1000
const distance = countDownSeconds - now const distance = countDownSeconds - now
if (distance <= 0) { if (distance <= 0) {
this.setState({ expired: true }) this.setState({ expired: true })
clearInterval(this.state.interval) const { interval } = this.state
clearInterval(interval)
return 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 usdAmount = btc.satoshisToUsd(balance.channelBalance, currentTicker.price_usd)
const { refreshing } = this.state
return ( return (
<div className={styles.network}> <div className={styles.network}>
<header className={styles.header}> <header className={styles.header}>
@ -202,7 +202,7 @@ class Network extends Component {
this.repeat = ref this.repeat = ref
}} }}
> >
{this.state.refreshing ? <FaRepeat /> : 'Refresh'} {refreshing ? <FaRepeat /> : 'Refresh'}
</span> </span>
</section> </section>
</header> </header>

5
app/components/GlobalError/GlobalError.js

@ -5,8 +5,9 @@ import styles from './GlobalError.scss'
class GlobalError extends React.Component { class GlobalError extends React.Component {
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if (!prevProps.error && this.props.error) { const { clearError, error } = this.props
setTimeout(this.props.clearError, 10000) 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 { class ReEnterSeed extends React.Component {
componentWillMount() { componentWillMount() {
this.props.setReEnterSeedIndexes() const { setReEnterSeedIndexes } = this.props
setReEnterSeedIndexes()
} }
render() { render() {

3
app/components/Wallet/ReceiveModal.js

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

Loading…
Cancel
Save