import React from 'react' import PropTypes from 'prop-types' import ReactModal from 'react-modal' import { MdClose } from 'react-icons/lib/md' import { FaCircle } from 'react-icons/lib/fa' import styles from './ContactsForm.scss' class ContactsForm extends React.Component { constructor(props) { super(props) this.state = { editing: false } } render() { const { contactsform, closeContactsForm, updateContactFormSearchQuery, updateContactCapacity, openChannel, activeChannelPubkeys, nonActiveChannelPubkeys, pendingOpenChannelPubkeys, filteredNetworkNodes } = this.props const { editing } = this.state const renderRightSide = (node) => { if (activeChannelPubkeys.includes(node.pub_key)) { return ( Online ) } if (nonActiveChannelPubkeys.includes(node.pub_key)) { return ( Offline ) } if (pendingOpenChannelPubkeys.includes(node.pub_key)) { return ( Pending ) } if (!node.addresses.length) { return ( Private ) } return ( openChannel({ pubkey: node.pub_key, host: node.addresses[0].addr, local_amt: contactsform.contactsform.contactCapacity })} > Connect ) } const inputClicked = () => { if (editing) { return } this.setState({ editing: true }) } return (
closeContactsForm} parentSelector={() => document.body} className={styles.modal} >

Add Contact

updateContactFormSearchQuery(event.target.value)} autoFocus />
    { contactsform.searchQuery.length > 0 && filteredNetworkNodes.map(node => { return (
  • { node.alias.length > 0 ?

    {node.alias.trim()} ({node.pub_key.substr(0, 10)}...{node.pub_key.substr(node.pub_key.length - 10)})

    :

    {node.pub_key}

    }
    {renderRightSide(node)}
  • ) }) }
) } } ContactsForm.propTypes = { } export default ContactsForm