From 65dbf6fa52d22099e8b5b32130eac70b54b15c42 Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Wed, 27 Jun 2018 16:52:28 -0400 Subject: [PATCH] feat(Transaction List): begin partner labels; get shift trades from kvstore --- .../src/components/TransactionListItem/index.js | 1 + .../src/components/TransactionListItem/template.js | 3 ++- .../scenes/Transactions/Bitcoin/Content/Pages/index.js | 4 ++-- .../Bitcoin/Content/Pages/template.success.js | 8 +++++++- .../src/scenes/Transactions/Bitcoin/Content/index.js | 5 +++-- .../src/scenes/Transactions/Bitcoin/Content/selectors.js | 8 +++++--- .../src/scenes/Transactions/Bitcoin/Content/template.js | 2 +- 7 files changed, 21 insertions(+), 10 deletions(-) diff --git a/packages/blockchain-wallet-v4-frontend/src/components/TransactionListItem/index.js b/packages/blockchain-wallet-v4-frontend/src/components/TransactionListItem/index.js index e89cbaafe64..c4918c39a46 100644 --- a/packages/blockchain-wallet-v4-frontend/src/components/TransactionListItem/index.js +++ b/packages/blockchain-wallet-v4-frontend/src/components/TransactionListItem/index.js @@ -40,6 +40,7 @@ class ListItemContainer extends React.PureComponent { transaction={this.props.transaction} handleCoinToggle={this.handleCoinToggle} handleEditDescription={this.handleEditDescription} + shiftTrades={this.props.shiftTrades} /> } } diff --git a/packages/blockchain-wallet-v4-frontend/src/components/TransactionListItem/template.js b/packages/blockchain-wallet-v4-frontend/src/components/TransactionListItem/template.js index 55da499b500..70cef0b9630 100644 --- a/packages/blockchain-wallet-v4-frontend/src/components/TransactionListItem/template.js +++ b/packages/blockchain-wallet-v4-frontend/src/components/TransactionListItem/template.js @@ -112,7 +112,8 @@ const dateHelper = (time) => { } const TransactionListItem = (props) => { - const { handleCoinToggle, transaction, handleEditDescription, coin, minConfirmations } = props + const { handleCoinToggle, transaction, handleEditDescription, coin, minConfirmations, shiftTrades } = props + if (transaction.description === 'sstx') console.log('TX:', transaction, shiftTrades) return ( diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/Pages/index.js b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/Pages/index.js index 24d3ec5a321..9c76c5f76a1 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/Pages/index.js +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/Pages/index.js @@ -6,10 +6,10 @@ import Success from './template.success' class Pages extends React.PureComponent { render () { - const { data } = this.props + const { data, shiftTrades } = this.props return data.cata({ - Success: (value) => , + Success: (value) => , Failure: () => this.props.onRefresh()} />, Loading: () => , NotAsked: () => diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/Pages/template.success.js b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/Pages/template.success.js index 8a0b8df21c8..98fba9fbb45 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/Pages/template.success.js +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/Pages/template.success.js @@ -15,7 +15,13 @@ const Wrapper = styled.div` const Success = props => { return ( - {props.transactions.map((transaction, index) => )} + {props.transactions.map((transaction, index) => )} ) } diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/index.js b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/index.js index 00305e9e857..0f1ab0e1da3 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/index.js +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/index.js @@ -22,8 +22,9 @@ class ContentContainer extends React.PureComponent { } render () { - const { empty, pages, search } = this.props - return + const { empty, pages, search, shiftTrades } = this.props + + return } } diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/selectors.js b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/selectors.js index beb05fa1d76..e13b3ed0338 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/selectors.js +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/selectors.js @@ -13,9 +13,10 @@ const filterTransactions = curry((status, criteria, transactions) => { export const getData = createSelector( [ selectors.form.getFormValues('btcTransactions'), - selectors.core.common.btc.getWalletTransactions + selectors.core.common.btc.getWalletTransactions, + selectors.core.kvStore.shapeShift.getTrades ], - (formValues, pages) => { + (formValues, pages, trades) => { const empty = (page) => isEmpty(page.data) const search = propOr('', 'search', formValues) const status = propOr('', 'status', formValues) @@ -26,7 +27,8 @@ export const getData = createSelector( return { pages: filteredPages, empty: all(empty)(filteredPages), - search: search.length > 0 || status !== '' + search: search.length > 0 || status !== '', + shiftTrades: trades.getOrElse([]) } } ) diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/template.js b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/template.js index a577d58f6b0..33bc9f4b4c9 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/template.js +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Bitcoin/Content/template.js @@ -17,7 +17,7 @@ const Success = props => { {props.empty ? props.search ? : - : props.pages.map((value, index) => ) + : props.pages.map((value, index) => ) } )