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' const ContactsForm = ({ contactsform, closeContactsForm, updateContactFormSearchQuery, openChannel, activeChannelPubkeys, nonActiveChannelPubkeys, pendingOpenChannelPubkeys, filteredNetworkNodes }) => { 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: 0.1 })} > Connect ) } return (
closeContactsForm} parentSelector={() => document.body} className={styles.modal} >

Add Contact

event.charCode === 13 && console.log('gaaaang')}>
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