import React, { Component } from 'react'
import PropTypes from 'prop-types'
import GlobalError from 'components/GlobalError'
import LoadingBolt from 'components/LoadingBolt'
import Form from 'components/Form'
import ChannelForm from 'components/Contacts/ChannelForm'
import Network from 'components/Contacts/Network'
import AddChannel from 'components/Contacts/AddChannel'
import ReceiveModal from 'components/Wallet/ReceiveModal'
import ActivityModal from 'components/Activity/ActivityModal'
import styles from './App.scss'
class App extends Component {
componentWillMount() {
const {
fetchTicker,
fetchInfo,
fetchChannels,
fetchSuggestedNodes,
fetchBalance,
fetchDescribeNetwork
} = this.props
// fetch price ticker
fetchTicker()
// fetch node info
fetchInfo()
// fetch nodes channels
fetchChannels()
// fetch suggested nodes list from zap.jackmallers.com/suggested-peers
fetchSuggestedNodes()
// fetch nodes balance
fetchBalance()
// fetch LN network from nides POV
fetchDescribeNetwork()
}
render() {
const {
currentTicker,
form,
formProps,
closeForm,
error: { error },
clearError,
contactsFormProps,
networkTabProps,
receiveModalProps,
activityModalProps,
channelFormProps,
children
} = this.props
if (!currentTicker) {
return