Browse Source

fix(lint): fix linting errors

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
18f6aa6f96
  1. 11
      app/components/Nav/Nav.js
  2. 7
      app/components/Wallet/ReceiveModal.js
  3. 19
      app/components/Wallet/Wallet.js
  4. 13
      app/routes/app/components/App.js
  5. 9
      app/routes/wallet/components/Wallet.js

11
app/components/Nav/Nav.js

@ -3,13 +3,10 @@ import PropTypes from 'prop-types'
import { NavLink } from 'react-router-dom' import { NavLink } from 'react-router-dom'
import ReactSVG from 'react-svg' import ReactSVG from 'react-svg'
import { MdAccountBalanceWallet } from 'react-icons/lib/md' import { MdAccountBalanceWallet } from 'react-icons/lib/md'
import { FaClockO, FaDollar } from 'react-icons/lib/fa' import { FaClockO } from 'react-icons/lib/fa'
import CryptoIcon from 'components/CryptoIcon'
import CurrencyIcon from 'components/CurrencyIcon'
import { btc, usd } from 'utils'
import styles from './Nav.scss' import styles from './Nav.scss'
const Nav = ({ ticker, balance, setCurrency, currentTicker, openPayForm, openRequestForm }) => ( const Nav = ({ openPayForm, openRequestForm }) => (
<nav className={styles.nav}> <nav className={styles.nav}>
<div className={styles.logo}> <div className={styles.logo}>
<ReactSVG path='../resources/zap_2.svg' /> <ReactSVG path='../resources/zap_2.svg' />
@ -40,10 +37,6 @@ const Nav = ({ ticker, balance, setCurrency, currentTicker, openPayForm, openReq
) )
Nav.propTypes = { Nav.propTypes = {
ticker: PropTypes.object.isRequired,
balance: PropTypes.object.isRequired,
setCurrency: PropTypes.func.isRequired,
currentTicker: PropTypes.object.isRequired,
openPayForm: PropTypes.func.isRequired, openPayForm: PropTypes.func.isRequired,
openRequestForm: PropTypes.func.isRequired openRequestForm: PropTypes.func.isRequired
} }

7
app/components/Wallet/ReceiveModal.js

@ -28,7 +28,7 @@ const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address }) => {
return ( return (
<ReactModal <ReactModal
isOpen isOpen={isOpen}
ariaHideApp ariaHideApp
shouldCloseOnOverlayClick shouldCloseOnOverlayClick
contentLabel='No Overlay Click Modal' contentLabel='No Overlay Click Modal'
@ -55,7 +55,10 @@ const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address }) => {
} }
ReceiveModal.propTypes = { ReceiveModal.propTypes = {
isOpen: PropTypes.bool.isRequired,
hideActivityModal: PropTypes.func.isRequired,
pubkey: PropTypes.string.isRequired,
address: PropTypes.string.isRequired
} }
export default ReceiveModal export default ReceiveModal

19
app/components/Wallet/Wallet.js

@ -2,7 +2,7 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { FaQrcode } from 'react-icons/lib/fa' import { FaQrcode } from 'react-icons/lib/fa'
import CryptoIcon from 'components/CryptoIcon' import CryptoIcon from 'components/CryptoIcon'
import { btc, usd } from 'utils' import { btc } from 'utils'
import ReceiveModal from './ReceiveModal' import ReceiveModal from './ReceiveModal'
import styles from './Wallet.scss' import styles from './Wallet.scss'
@ -18,11 +18,9 @@ class Wallet extends Component {
render() { render() {
const { const {
ticker, ticker,
currentTicker,
balance, balance,
address, address,
info, info
showModal
} = this.props } = this.props
const { modalOpen } = this.state const { modalOpen } = this.state
@ -62,23 +60,12 @@ class Wallet extends Component {
) )
} }
} }
// const Wallet = ({ ticker, currentTicker, balance, address, info, showModal }) => {
// const copyOnClick = data => {
// copy(data)
// showNotification('Noice', 'Successfully copied to clipboard')
// }
// return (
// )
// }
Wallet.propTypes = { Wallet.propTypes = {
ticker: PropTypes.object.isRequired, ticker: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired,
balance: PropTypes.object.isRequired, balance: PropTypes.object.isRequired,
address: PropTypes.string.isRequired, address: PropTypes.string.isRequired,
info: PropTypes.object.isRequired, info: PropTypes.object.isRequired
showModal: PropTypes.func.isRequired
} }
export default Wallet export default Wallet

13
app/routes/app/components/App.js

@ -27,15 +27,13 @@ class App extends Component {
fetchBlockHeight, fetchBlockHeight,
modal: { modalType, modalProps }, modal: { modalType, modalProps },
showModal,
hideModal, hideModal,
ticker, ticker,
currentTicker,
address: { address }, address: { address },
balance, balance,
info, info,
form, form,
setCurrency,
currentTicker,
openPayForm, openPayForm,
openRequestForm, openRequestForm,
@ -70,10 +68,6 @@ class App extends Component {
<Form formType={form.formType} formProps={formProps} closeForm={closeForm} /> <Form formType={form.formType} formProps={formProps} closeForm={closeForm} />
<Nav <Nav
ticker={ticker}
balance={balance}
setCurrency={setCurrency}
currentTicker={currentTicker}
openPayForm={openPayForm} openPayForm={openPayForm}
openRequestForm={openRequestForm} openRequestForm={openRequestForm}
/> />
@ -81,11 +75,9 @@ class App extends Component {
<div className={styles.content}> <div className={styles.content}>
<Wallet <Wallet
ticker={ticker} ticker={ticker}
currentTicker={currentTicker}
balance={balance} balance={balance}
address={address} address={address}
info={info} info={info}
showModal={showModal}
/> />
{children} {children}
</div> </div>
@ -104,15 +96,16 @@ App.propTypes = {
ticker: PropTypes.object.isRequired, ticker: PropTypes.object.isRequired,
address: PropTypes.object.isRequired, address: PropTypes.object.isRequired,
balance: PropTypes.object.isRequired, balance: PropTypes.object.isRequired,
info: PropTypes.object.isRequired,
form: PropTypes.object.isRequired, form: PropTypes.object.isRequired,
formProps: PropTypes.object.isRequired, formProps: PropTypes.object.isRequired,
closeForm: PropTypes.func.isRequired, closeForm: PropTypes.func.isRequired,
newAddress: PropTypes.func.isRequired,
fetchInfo: PropTypes.func.isRequired, fetchInfo: PropTypes.func.isRequired,
hideModal: PropTypes.func.isRequired, hideModal: PropTypes.func.isRequired,
fetchTicker: PropTypes.func.isRequired, fetchTicker: PropTypes.func.isRequired,
fetchBalance: PropTypes.func.isRequired, fetchBalance: PropTypes.func.isRequired,
setCurrency: PropTypes.func.isRequired,
openPayForm: PropTypes.func.isRequired, openPayForm: PropTypes.func.isRequired,
openRequestForm: PropTypes.func.isRequired, openRequestForm: PropTypes.func.isRequired,

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

@ -1,23 +1,19 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import ReactSVG from 'react-svg'
import Channels from 'components/Channels' import Channels from 'components/Channels'
import Peers from 'components/Peers' import Peers from 'components/Peers'
import styles from './Wallet.scss' import styles from './Wallet.scss'
class Wallet extends Component { class Wallet extends Component {
componentWillMount() { componentWillMount() {
const { fetchPeers, fetchChannels, newAddress } = this.props const { fetchPeers, fetchChannels } = this.props
fetchPeers() fetchPeers()
fetchChannels() fetchChannels()
newAddress('p2pkh')
} }
render() { render() {
const { const {
info,
address: { address },
ticker, ticker,
peers: { peersLoading, peers, peer, peerForm }, peers: { peersLoading, peers, peer, peerForm },
channels: { channelsLoading, channels, channel, channelForm, pendingChannels }, channels: { channelsLoading, channels, channel, channelForm, pendingChannels },
@ -80,7 +76,6 @@ class Wallet extends Component {
Wallet.propTypes = { Wallet.propTypes = {
fetchPeers: PropTypes.func.isRequired, fetchPeers: PropTypes.func.isRequired,
fetchChannels: PropTypes.func.isRequired, fetchChannels: PropTypes.func.isRequired,
info: PropTypes.object.isRequired,
ticker: PropTypes.object.isRequired, ticker: PropTypes.object.isRequired,
peers: PropTypes.object.isRequired, peers: PropTypes.object.isRequired,
channels: PropTypes.object.isRequired, channels: PropTypes.object.isRequired,
@ -95,8 +90,6 @@ Wallet.propTypes = {
allChannels: PropTypes.array.isRequired, allChannels: PropTypes.array.isRequired,
openChannel: PropTypes.func.isRequired, openChannel: PropTypes.func.isRequired,
closeChannel: PropTypes.func.isRequired, closeChannel: PropTypes.func.isRequired,
newAddress: PropTypes.func.isRequired,
address: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired, currentTicker: PropTypes.object.isRequired,
explorerLinkBase: PropTypes.string.isRequired explorerLinkBase: PropTypes.string.isRequired
} }

Loading…
Cancel
Save