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

10
app/reducers/payform.js

@ -51,9 +51,9 @@ const ACTION_HANDLERS = {
// Selector
// ------------------------------------
const payFormSelectors = {}
const payAmountSelector = state => state.payform.payInput
const payAmountSelector = state => state.payform.amount
const payInputSelector = state => state.payform.payInput
const currencySelector = state => state.ticker.currencySelector
const currencySelector = state => state.ticker.currency
payFormSelectors.isOnchain = createSelector(
payInputSelector,
@ -80,7 +80,11 @@ payFormSelectors.inputCaption = createSelector(
payAmountSelector,
currencySelector,
(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) {
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
} = this.props
console.log('formProps: ', this.props.formProps)
if (!currentTicker) { return <div>Loading...</div> }
return (

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

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

Loading…
Cancel
Save