import React, { Component } from 'react' import PropTypes from 'prop-types' import { InteractiveForceGraph, ForceGraphNode, ForceGraphLink } from 'react-vis-force' import LoadingBolt from 'components/LoadingBolt' import PeersList from 'components/Network/PeersList' import styles from './Network.scss' class Network extends Component { componentWillMount() { const { fetchDescribeNetwork, fetchPeers } = this.props fetchPeers() fetchDescribeNetwork() } render() { const { setCurrentTab, network: { nodes, edges, networkLoading, currentTab }, peers: { peers }, identity_pubkey } = this.props const renderContent = () => { switch(currentTab) { case 1: return break case 2: return

channels

break case 3: return

transactions

break } } if (!nodes.length || !edges.length) { return } if (networkLoading) return return (
console.log('node: ', node)} opacityFactor={1} highlightDependencies zoomOptions={{ minScale: 0.1, maxScale: 5, scale: 0.2 }} zoom > { nodes.map(node => { return ( ) }) } { edges.map(edge => { return ( ) }) }
  • setCurrentTab(1)} > Peers
  • setCurrentTab(2)} > Channels
  • setCurrentTab(3)} > Transactions
{renderContent()}
) } } Network.propTypes = { fetchDescribeNetwork: PropTypes.func.isRequired, fetchPeers: PropTypes.func.isRequired, setCurrentTab: PropTypes.func.isRequired, network: PropTypes.object.isRequired, peers: PropTypes.object.isRequired, identity_pubkey: PropTypes.string.isRequired } export default Network