import React from 'react' import PropTypes from 'prop-types' import Isvg from 'react-inlinesvg' import hand from 'icons/hand.svg' import { FaAngleDown } from 'react-icons/lib/fa' import { btc } from 'utils' import styles from './Request.scss' const Request = ({ requestform: { amount, memo, showCurrencyFilters }, ticker, setRequestAmount, setRequestMemo, setCurrency, setRequestCurrencyFilters, currencyName, requestUsdAmount, currentCurrencyFilters, onRequestSubmit }) => { const onCurrencyFilterClick = (currency) => { // change the input amount setRequestAmount(btc.convert(ticker.currency, currency, amount)) setCurrency(currency) setRequestCurrencyFilters(false) } return (

Request Payment

setRequestMemo(event.target.value)} id='memo' />
setRequestAmount(event.target.value)} id='amount' placeholder='0.00000000' />
setRequestCurrencyFilters(!showCurrencyFilters)}> {currencyName}
    { currentCurrencyFilters.map(filter =>
  • onCurrencyFilterClick(filter.key)}>{filter.name}
  • ) }
{`≈ ${requestUsdAmount || 0} USD`}
0 && styles.active}`} onClick={onRequestSubmit}> Request
) } Request.propTypes = { requestform: PropTypes.shape({ amount: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), memo: PropTypes.string }).isRequired, requestUsdAmount: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), currencyName: PropTypes.string.isRequired, currentCurrencyFilters: PropTypes.array.isRequired, setRequestAmount: PropTypes.func.isRequired, setRequestMemo: PropTypes.func.isRequired, onRequestSubmit: PropTypes.func.isRequired, setCurrency: PropTypes.func.isRequired, setRequestCurrencyFilters: PropTypes.func.isRequired, ticker: PropTypes.object.isRequired } export default Request