This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): show payment route on probe summary
- Loading branch information
Showing
14 changed files
with
140 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export PaymentModal from './PaymentModal' | ||
export Route from './Route' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import payReducer from './reducer' | ||
|
||
export default payReducer | ||
export paySelectors from './selectors' | ||
export * from './constants' | ||
export * from './reducer' | ||
export * from './ipc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { createSelector } from 'reselect' | ||
import { networkSelectors } from 'reducers/network' | ||
import { decorateRoute } from 'reducers/payment/utils' | ||
|
||
/** | ||
* @typedef {import('../index').State} State | ||
*/ | ||
|
||
const routesSelector = state => state.pay.routes | ||
const nodesSelector = state => networkSelectors.nodes(state) | ||
|
||
/** | ||
* routes - Routes relating to current payment probe.. | ||
* | ||
* @param {State} state Redux state | ||
* @returns {object} Config overrides | ||
*/ | ||
export const routes = createSelector(routesSelector, nodesSelector, (routes, nodes) => | ||
routes.map(route => decorateRoute(route, nodes)) | ||
) | ||
|
||
/** | ||
* isQueryingFees - Is querying fees. | ||
* | ||
* @param {State} state Redux state | ||
* @returns {boolean} Boolean indicating if fees are being queried | ||
*/ | ||
const isQueryingFees = state => state.pay.isQueryingFees | ||
|
||
/** | ||
* isQueryingRoutes - Is querying routes. | ||
* | ||
* @param {State} state Redux state | ||
* @returns {boolean} Boolean indicating if routes are being probed | ||
*/ | ||
const isQueryingRoutes = state => state.pay.isQueryingRoutes | ||
|
||
/** | ||
* onchainFees - Onchain fee rates | ||
* | ||
* @param {State} state Redux state | ||
* @returns {{fast:string|null, medium:string|null, slow:string|null}} Onchain fee rates | ||
*/ | ||
const onchainFees = state => state.pay.onchainFees | ||
|
||
/** | ||
* redirectPayReq - Payrequest injected from external source | ||
* | ||
* @param {State} state Redux state | ||
* @returns {string|null} Payrequest injected from external source | ||
*/ | ||
const redirectPayReq = state => state.pay.redirectPayReq | ||
|
||
export default { | ||
isQueryingFees, | ||
isQueryingRoutes, | ||
onchainFees, | ||
redirectPayReq, | ||
routes, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters