-
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.
- Loading branch information
Philip London
committed
Mar 23, 2020
1 parent
183ebff
commit 09605a0
Showing
7 changed files
with
78 additions
and
32 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
19 changes: 0 additions & 19 deletions
19
packages/blockchain-wallet-v4-frontend/src/scenes/Home/Balances/CoinBalance/selectors.js
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
packages/blockchain-wallet-v4-frontend/src/scenes/Home/Balances/CoinBalance/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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import * as lockboxBalanceSelectors from 'components/Balances/lockbox/selectors' | ||
import * as totalBalanceSelectors from 'components/Balances/total/selectors' | ||
import * as walletBalanceSelectors from 'components/Balances/wallet/selectors' | ||
import { OwnProps } from '.' | ||
import { Remote } from 'blockchain-wallet-v4/src' | ||
|
||
export const getData = (state, ownProps: OwnProps) => { | ||
switch (ownProps.viewType) { | ||
case 'Wallet': | ||
switch (ownProps.coin) { | ||
case 'BTC': | ||
return walletBalanceSelectors.getBtcBalance(state) | ||
case 'BCH': | ||
return walletBalanceSelectors.getBchBalance(state) | ||
case 'ETH': | ||
return walletBalanceSelectors.getEthBalance(state) | ||
case 'XLM': | ||
return walletBalanceSelectors.getXlmBalance(state) | ||
case 'PAX': | ||
return walletBalanceSelectors.getPaxBalance(state) | ||
default: | ||
return Remote.Failure('Unsupported Coin Code') | ||
} | ||
case 'Hardware': | ||
switch (ownProps.coin) { | ||
case 'BTC': | ||
return lockboxBalanceSelectors.getLockboxBtcBalance(state) | ||
case 'BCH': | ||
return lockboxBalanceSelectors.getLockboxBchBalance(state) | ||
case 'ETH': | ||
return lockboxBalanceSelectors.getLockboxEthBalance(state) | ||
case 'XLM': | ||
return lockboxBalanceSelectors.getLockboxXlmBalance(state) | ||
default: | ||
return Remote.Failure('Unsupported Coin Code') | ||
} | ||
default: | ||
switch (ownProps.coin) { | ||
case 'BTC': | ||
return totalBalanceSelectors.getBtcBalance(state) | ||
case 'BCH': | ||
return totalBalanceSelectors.getBchBalance(state) | ||
case 'ETH': | ||
return totalBalanceSelectors.getEthBalance(state) | ||
case 'XLM': | ||
return totalBalanceSelectors.getXlmBalance(state) | ||
case 'PAX': | ||
return totalBalanceSelectors.getPaxBalance(state) | ||
default: | ||
return Remote.Failure('Unsupported Coin Code') | ||
} | ||
} | ||
} |
12 changes: 10 additions & 2 deletions
12
...d/src/scenes/Home/Balances/Table/index.js → .../src/scenes/Home/Balances/Table/index.tsx
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