Browse Source

fix(app continer): clean up unused code from app container

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
8d3c91e218
  1. 49
      app/routes/app/containers/AppContainer.js

49
app/routes/app/containers/AppContainer.js

@ -1,17 +1,20 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { fetchTicker, setCurrency, tickerSelectors } from 'reducers/ticker' import { fetchTicker, setCurrency, tickerSelectors } from 'reducers/ticker'
import { fetchBalance } from 'reducers/balance' import { fetchBalance } from 'reducers/balance'
import { fetchInfo } from 'reducers/info' import { fetchInfo } from 'reducers/info'
import { createInvoice, fetchInvoice } from 'reducers/invoice'
import { showModal, hideModal } from 'reducers/modal' import { showModal, hideModal } from 'reducers/modal'
import { payInvoice } from 'reducers/payment'
import { sendCoins } from 'reducers/transaction'
import { fetchChannels } from 'reducers/channels'
import { setFormType } from 'reducers/form'
import { setFormType } from 'reducers/form'
import { setPayAmount, setPayInput, payFormSelectors } from 'reducers/payform' import { setPayAmount, setPayInput, payFormSelectors } from 'reducers/payform'
import { setRequestAmount, setRequestMemo } from 'reducers/requestform' import { setRequestAmount, setRequestMemo } from 'reducers/requestform'
import { sendCoins } from 'reducers/transaction'
import { payInvoice } from 'reducers/payment'
import { createInvoice, fetchInvoice } from 'reducers/invoice'
import App from '../components/App' import App from '../components/App'
@ -19,22 +22,24 @@ const mapDispatchToProps = {
fetchTicker, fetchTicker,
setCurrency, setCurrency,
fetchBalance, fetchBalance,
fetchInfo, fetchInfo,
createInvoice,
hideModal,
payInvoice,
sendCoins,
fetchChannels,
fetchInvoice,
showModal, showModal,
hideModal,
setFormType,
setPayAmount, setPayAmount,
setPayInput, setPayInput,
setRequestAmount,
setRequestMemo,
setRequestAmount,setRequestMemo,
setFormType sendCoins,
payInvoice,
createInvoice,
fetchInvoice
} }
const mapStateToProps = state => ({ const mapStateToProps = state => ({
@ -101,14 +106,14 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
setRequestAmount: dispatchProps.setRequestAmount, setRequestAmount: dispatchProps.setRequestAmount,
setRequestMemo: dispatchProps.setRequestMemo, setRequestMemo: dispatchProps.setRequestMemo,
onRequestSubmit: () => { onRequestSubmit: () => (
dispatchProps.createInvoice( dispatchProps.createInvoice(
stateProps.requestform.amount, stateProps.requestform.amount,
stateProps.requestform.memo, stateProps.requestform.memo,
stateProps.ticker.currency, stateProps.ticker.currency,
stateProps.currentTicker.price_usd stateProps.currentTicker.price_usd
) )
} )
} }
const formProps = (formType) => { const formProps = (formType) => {
@ -124,17 +129,11 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
...ownProps, ...ownProps,
// action to open the pay form // action to open the pay form
openPayForm: () => { openPayForm: () => dispatchProps.setFormType('PAY_FORM'),
dispatchProps.setFormType('PAY_FORM')
},
// action to open the request form // action to open the request form
openRequestForm: () => { openRequestForm: () => dispatchProps.setFormType('REQUEST_FORM'),
dispatchProps.setFormType('REQUEST_FORM')
},
// action to close form // action to close form
closeForm: () => { closeForm: () => dispatchProps.setFormType(null),
dispatchProps.setFormType(null)
},
// Props to pass to the pay form // Props to pass to the pay form
formProps: formProps(stateProps.form.formType) formProps: formProps(stateProps.form.formType)

Loading…
Cancel
Save