import React, { Component } from 'react' import PropTypes from 'prop-types' import { FaBolt, FaChain } from 'react-icons/lib/fa' import CurrencyIcon from 'components/CurrencyIcon' import styles from './PayForm.scss' class PayForm extends Component { componentDidUpdate(prevProps) { const { isOnchain, isLn, payform: { payInput }, fetchInvoice } = this.props console.log('prevProps: ', prevProps) console.log('props: ', this.props) // If on-chain, focus on amount to let user know it's editable if (isOnchain) { this.amountInput.focus() } // If LN go retrieve invoice details if ((prevProps.payform.payInput !== payInput) && isLn) { fetchInvoice(payInput) } } render() { const { payform, currency, crypto, isOnchain, isLn, inputCaption, setPayAmount, setPayInput, onPaySubmit } = this.props return (