Browse Source
style(lint): fix issues from rule react/destructuring-assignment
renovate/lint-staged-8.x
Tom Kirkpatrick
7 years ago
No known key found for this signature in database
GPG Key ID: 72203A8EC5967EA8
5 changed files with
15 additions and
9 deletions
-
app/components/Activity/Countdown.js
-
app/components/Contacts/Network.js
-
app/components/GlobalError/GlobalError.js
-
app/components/Onboarding/ReEnterSeed.js
-
app/components/Wallet/ReceiveModal.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 |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -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,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) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -4,7 +4,8 @@ import styles from './ReEnterSeed.scss' |
|
|
|
|
|
|
|
class ReEnterSeed extends React.Component { |
|
|
|
componentWillMount() { |
|
|
|
this.props.setReEnterSeedIndexes() |
|
|
|
const { setReEnterSeedIndexes } = this.props |
|
|
|
setReEnterSeedIndexes() |
|
|
|
} |
|
|
|
|
|
|
|
render() { |
|
|
|
|
|
@ -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 }) |
|
|
|