Browse Source

fix(inputCaption): fix input caption selector

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
3fee043b47
  1. 4
      app/components/Form/PayForm.js
  2. 10
      app/reducers/payform.js
  3. 1
      app/routes/app/components/App.js
  4. 2
      app/routes/app/containers/AppContainer.js

4
app/components/Form/PayForm.js

@ -20,6 +20,7 @@ class PayForm extends Component {
onPaySubmit onPaySubmit
} = this.props } = this.props
console.log('inputCaption: ', inputCaption)
return ( return (
<div className={styles.container}> <div className={styles.container}>
<section className={`${styles.amountContainer} ${isLn ? styles.ln : ''}`}> <section className={`${styles.amountContainer} ${isLn ? styles.ln : ''}`}>
@ -43,6 +44,9 @@ class PayForm extends Component {
/> />
</section> </section>
<div className={styles.inputContainer}> <div className={styles.inputContainer}>
<div className={styles.info}>
<span>{inputCaption}</span>
</div>
<aside className={styles.paymentIcon}> <aside className={styles.paymentIcon}>
{(() => { {(() => {
if (isOnchain) { if (isOnchain) {

10
app/reducers/payform.js

@ -51,9 +51,9 @@ const ACTION_HANDLERS = {
// Selector // Selector
// ------------------------------------ // ------------------------------------
const payFormSelectors = {} const payFormSelectors = {}
const payAmountSelector = state => state.payform.payInput const payAmountSelector = state => state.payform.amount
const payInputSelector = state => state.payform.payInput const payInputSelector = state => state.payform.payInput
const currencySelector = state => state.ticker.currencySelector const currencySelector = state => state.ticker.currency
payFormSelectors.isOnchain = createSelector( payFormSelectors.isOnchain = createSelector(
payInputSelector, payInputSelector,
@ -80,7 +80,11 @@ payFormSelectors.inputCaption = createSelector(
payAmountSelector, payAmountSelector,
currencySelector, currencySelector,
(isOnchain, isLn, amount, currency) => { (isOnchain, isLn, amount, currency) => {
if (!isOnchain || !isLn) { return } console.log('isOnchain: ', isOnchain)
console.log('isLn: ', isLn)
console.log('amount: ', amount)
console.log('currency: ', currency)
if (!isOnchain && !isLn) { return }
if (isOnchain) { if (isOnchain) {
return `You're about to send ${amount} ${currency.toUpperCase()} on-chain which should take around 10 minutes` return `You're about to send ${amount} ${currency.toUpperCase()} on-chain which should take around 10 minutes`

1
app/routes/app/components/App.js

@ -48,7 +48,6 @@ class App extends Component {
children children
} = this.props } = this.props
console.log('formProps: ', this.props.formProps)
if (!currentTicker) { return <div>Loading...</div> } if (!currentTicker) { return <div>Loading...</div> }
return ( return (

2
app/routes/app/containers/AppContainer.js

@ -66,7 +66,7 @@ const mapStateToProps = state => ({
currentTicker: tickerSelectors.currentTicker(state), currentTicker: tickerSelectors.currentTicker(state),
isOnchain: payFormSelectors.isOnchain(state), isOnchain: payFormSelectors.isOnchain(state),
isLn: payFormSelectors.isLn(state), isLn: payFormSelectors.isLn(state),
inputCaption: payFormSelectors.isLn(state) inputCaption: payFormSelectors.inputCaption(state)
}) })
const mergeProps = (stateProps, dispatchProps, ownProps) => { const mergeProps = (stateProps, dispatchProps, ownProps) => {

Loading…
Cancel
Save