import React from 'react' import PropTypes from 'prop-types' import ReactModal from 'react-modal' import { FaUser } from 'react-icons/lib/fa' import CurrencyIcon from 'components/CurrencyIcon' import { usd, btc } from 'utils' import styles from './ChannelForm.scss' const ChannelForm = ({ form, setForm, ticker, peers, openChannel, currentTicker }) => { const submitClicked = () => { const { node_key, local_amt, push_amt } = form const localamt = ticker.currency === 'usd' ? btc.btcToSatoshis(usd.usdToBtc(local_amt, currentTicker.price_usd)) : btc.btcToSatoshis(local_amt) const pushamt = ticker.currency === 'usd' ? btc.btcToSatoshis(usd.usdToBtc(push_amt, currentTicker.price_usd)) : btc.btcToSatoshis(push_amt) openChannel({ pubkey: node_key, localamt, pushamt }) setForm({ isOpen: false }) } const customStyles = { overlay: { cursor: 'pointer', overflowY: 'auto' }, content: { top: 'auto', left: '20%', right: '0', bottom: 'auto', width: '40%', margin: '50px auto', padding: '40px' } } return (