|
|
@ -17,9 +17,32 @@ import { createInvoice, fetchInvoice } from 'reducers/invoice' |
|
|
|
|
|
|
|
import { fetchBlockHeight, lndSelectors } from 'reducers/lnd' |
|
|
|
|
|
|
|
import { fetchChannels } from 'reducers/channels' |
|
|
|
import { |
|
|
|
fetchChannels, |
|
|
|
openChannel, |
|
|
|
channelsSelectors, |
|
|
|
currentChannels, |
|
|
|
|
|
|
|
toggleFilterPulldown, |
|
|
|
changeFilter, |
|
|
|
|
|
|
|
updateChannelSearchQuery |
|
|
|
} from 'reducers/channels' |
|
|
|
|
|
|
|
import { |
|
|
|
openContactsForm, |
|
|
|
closeContactsForm, |
|
|
|
updateContactFormSearchQuery, |
|
|
|
updateManualFormSearchQuery, |
|
|
|
updateContactCapacity, |
|
|
|
contactFormSelectors, |
|
|
|
updateManualFormErrors |
|
|
|
} from 'reducers/contactsform' |
|
|
|
|
|
|
|
import { fetchBalance } from 'reducers/balance' |
|
|
|
|
|
|
|
import { fetchDescribeNetwork } from 'reducers/network' |
|
|
|
|
|
|
|
import { clearError } from 'reducers/error' |
|
|
|
|
|
|
|
|
|
|
@ -53,8 +76,23 @@ const mapDispatchToProps = { |
|
|
|
fetchBlockHeight, |
|
|
|
clearError, |
|
|
|
|
|
|
|
fetchBalance, |
|
|
|
|
|
|
|
fetchChannels, |
|
|
|
fetchBalance |
|
|
|
openChannel, |
|
|
|
toggleFilterPulldown, |
|
|
|
changeFilter, |
|
|
|
updateChannelSearchQuery, |
|
|
|
|
|
|
|
openContactsForm, |
|
|
|
closeContactsForm, |
|
|
|
updateContactFormSearchQuery, |
|
|
|
updateManualFormSearchQuery, |
|
|
|
updateContactCapacity, |
|
|
|
contactFormSelectors, |
|
|
|
updateManualFormErrors, |
|
|
|
|
|
|
|
fetchDescribeNetwork |
|
|
|
} |
|
|
|
|
|
|
|
const mapStateToProps = state => ({ |
|
|
@ -65,7 +103,9 @@ const mapStateToProps = state => ({ |
|
|
|
info: state.info, |
|
|
|
payment: state.payment, |
|
|
|
transaction: state.transaction, |
|
|
|
peers: state.peers, |
|
|
|
channels: state.channels, |
|
|
|
contactsform: state.contactsform, |
|
|
|
balance: state.balance, |
|
|
|
|
|
|
|
form: state.form, |
|
|
@ -77,6 +117,8 @@ const mapStateToProps = state => ({ |
|
|
|
|
|
|
|
error: state.error, |
|
|
|
|
|
|
|
network: state.network, |
|
|
|
|
|
|
|
currentTicker: tickerSelectors.currentTicker(state), |
|
|
|
isOnchain: payFormSelectors.isOnchain(state), |
|
|
|
isLn: payFormSelectors.isLn(state), |
|
|
@ -84,7 +126,17 @@ const mapStateToProps = state => ({ |
|
|
|
inputCaption: payFormSelectors.inputCaption(state), |
|
|
|
showPayLoadingScreen: payFormSelectors.showPayLoadingScreen(state), |
|
|
|
payFormIsValid: payFormSelectors.payFormIsValid(state), |
|
|
|
syncPercentage: lndSelectors.syncPercentage(state) |
|
|
|
syncPercentage: lndSelectors.syncPercentage(state), |
|
|
|
|
|
|
|
filteredNetworkNodes: contactFormSelectors.filteredNetworkNodes(state), |
|
|
|
showManualForm: contactFormSelectors.showManualForm(state), |
|
|
|
manualFormIsValid: contactFormSelectors.manualFormIsValid(state), |
|
|
|
|
|
|
|
currentChannels: currentChannels(state), |
|
|
|
activeChannelPubkeys: channelsSelectors.activeChannelPubkeys(state), |
|
|
|
nonActiveChannelPubkeys: channelsSelectors.nonActiveChannelPubkeys(state), |
|
|
|
pendingOpenChannelPubkeys: channelsSelectors.pendingOpenChannelPubkeys(state), |
|
|
|
nonActiveFilters: channelsSelectors.nonActiveFilters(state) |
|
|
|
}) |
|
|
|
|
|
|
|
const mergeProps = (stateProps, dispatchProps, ownProps) => { |
|
|
@ -180,16 +232,57 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { |
|
|
|
return {} |
|
|
|
} |
|
|
|
|
|
|
|
const networkTabProps = { |
|
|
|
currentChannels: stateProps.currentChannels, |
|
|
|
channels: stateProps.channels, |
|
|
|
balance: stateProps.balance, |
|
|
|
currentTicker: stateProps.currentTicker, |
|
|
|
contactsform: stateProps.contactsform, |
|
|
|
nodes: stateProps.network.nodes, |
|
|
|
nonActiveFilters: stateProps.nonActiveFilters, |
|
|
|
|
|
|
|
fetchChannels: dispatchProps.fetchChannels, |
|
|
|
openContactsForm: dispatchProps.openContactsForm, |
|
|
|
contactFormSelectors: dispatchProps.contactFormSelectors, |
|
|
|
updateManualFormError: dispatchProps.updateManualFormErrors, |
|
|
|
toggleFilterPulldown: dispatchProps.toggleFilterPulldown, |
|
|
|
changeFilter: dispatchProps.changeFilter, |
|
|
|
updateChannelSearchQuery: dispatchProps.updateChannelSearchQuery |
|
|
|
} |
|
|
|
|
|
|
|
const contactsFormProps = { |
|
|
|
closeContactsForm: dispatchProps.closeContactsForm, |
|
|
|
updateContactFormSearchQuery: dispatchProps.updateContactFormSearchQuery, |
|
|
|
updateManualFormSearchQuery: dispatchProps.updateManualFormSearchQuery, |
|
|
|
updateContactCapacity: dispatchProps.updateContactCapacity, |
|
|
|
openChannel: dispatchProps.openChannel, |
|
|
|
updateManualFormErrors: dispatchProps.updateManualFormErrors, |
|
|
|
|
|
|
|
contactsform: stateProps.contactsform, |
|
|
|
filteredNetworkNodes: stateProps.filteredNetworkNodes, |
|
|
|
loadingChannelPubkeys: stateProps.channels.loadingChannelPubkeys, |
|
|
|
showManualForm: stateProps.showManualForm, |
|
|
|
manualFormIsValid: stateProps.manualFormIsValid, |
|
|
|
activeChannelPubkeys: stateProps.activeChannelPubkeys, |
|
|
|
nonActiveChannelPubkeys: stateProps.nonActiveChannelPubkeys, |
|
|
|
pendingOpenChannelPubkeys: stateProps.pendingOpenChannelPubkeys |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
...stateProps, |
|
|
|
...dispatchProps, |
|
|
|
...ownProps, |
|
|
|
|
|
|
|
// props for the network sidebar
|
|
|
|
networkTabProps, |
|
|
|
// props for the contacts form
|
|
|
|
contactsFormProps, |
|
|
|
// Props to pass to the pay form
|
|
|
|
formProps: formProps(stateProps.form.formType), |
|
|
|
// action to close form
|
|
|
|
closeForm: () => dispatchProps.setFormType(null) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|