import React, { Component } from 'react' import PropTypes from 'prop-types' import { ForceGraph, ForceGraphNode, ForceGraphLink } from 'react-vis-force' import { FaCircle } from 'react-icons/lib/fa' import styles from './NetworkChannels.scss' class NetworkChannels extends Component { constructor(props) { super(props) this.state = { ready: false } } componentWillMount() { setTimeout(() => { this.setState({ ready: true }) }, 1000) this.props.setCurrentChannel(this.props.channels[0]) } render() { const { ready } = this.state const { channels, network: { nodes, edges, selectedChannel, networkLoading }, identity_pubkey, setCurrentChannel } = this.props if (!ready || networkLoading) { return (

loading network graph

) } return (
{ nodes.map(node => ( )) } { edges.map(edge => ( )) }
) } } NetworkChannels.propTypes = { channels: PropTypes.array.isRequired, network: PropTypes.object.isRequired, identity_pubkey: PropTypes.string.isRequired, setCurrentChannel: PropTypes.func.isRequired } export default NetworkChannels