-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(swap): make swap coins more dynamic
- Loading branch information
plondon
committed
Jul 15, 2021
1 parent
7077346
commit 6804a99
Showing
10 changed files
with
33 additions
and
36 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
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
15 changes: 8 additions & 7 deletions
15
packages/blockchain-wallet-v4-frontend/src/modals/Swap/InitSwapForm/selectors.ts
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,11 +1,12 @@ | ||
import { createDeepEqualSelector } from 'blockchain-wallet-v4/src/utils' | ||
import { selectors } from 'data' | ||
import { SWAP_ACCOUNTS_SELECTOR } from 'data/coins/model/swap' | ||
import { getCoinAccounts } from 'data/coins/selectors' | ||
import { RootState } from 'data/rootReducer' | ||
|
||
export const getData = createDeepEqualSelector( | ||
[(state: RootState) => getCoinAccounts(state, SWAP_ACCOUNTS_SELECTOR)], | ||
accounts => { | ||
return { accounts } | ||
} | ||
) | ||
export const getData = (state: RootState) => { | ||
const coins = selectors.components.swap.getCoins() | ||
const accounts = getCoinAccounts(state, { coins, ...SWAP_ACCOUNTS_SELECTOR }) | ||
return { accounts } | ||
} | ||
|
||
export default getData |