From 8c9af6aa1d1ca812c9d12bd81389a931f2761bb1 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 19 Aug 2021 19:41:58 +0200 Subject: [PATCH] coming along well --- ui/component/txoList/view.jsx | 9 ++-- .../walletFiatAccountHistory/view.jsx | 6 +-- .../walletFiatPaymentHistory/view.jsx | 5 +- ui/page/wallet/view.jsx | 46 ++++++------------- 4 files changed, 23 insertions(+), 43 deletions(-) diff --git a/ui/component/txoList/view.jsx b/ui/component/txoList/view.jsx index ea053e9e4..db094eccb 100644 --- a/ui/component/txoList/view.jsx +++ b/ui/component/txoList/view.jsx @@ -104,7 +104,9 @@ function TxoList(props: Props) { // console.log('amount of transactions'); // console.log(customerTransactionResponse.length); - customerTransactionResponse.reverse(); + if(customerTransactionResponse && customerTransactionResponse.length){ + customerTransactionResponse.reverse(); + } setCustomerTransactions(customerTransactionResponse); } catch (err) { @@ -477,8 +479,9 @@ function TxoList(props: Props) { {/* listing of the transactions */} - { fiatType === 'incoming' && } - { fiatType === 'outgoing' && } + { fiatType === 'incoming' && } + { fiatType === 'outgoing' && } + {/* TODO: have to finish pagination */} diff --git a/ui/component/walletFiatAccountHistory/view.jsx b/ui/component/walletFiatAccountHistory/view.jsx index 970ee824b..07616c2f7 100644 --- a/ui/component/walletFiatAccountHistory/view.jsx +++ b/ui/component/walletFiatAccountHistory/view.jsx @@ -21,9 +21,9 @@ const WalletBalance = (props: Props) => { } // if there are more than 10 transactions, limit it to 10 for the frontend - if (accountTransactions && accountTransactions.length > 10) { - accountTransactions.length = 10; - } + // if (accountTransactions && accountTransactions.length > 10) { + // accountTransactions.length = 10; + // } return (
diff --git a/ui/component/walletFiatPaymentHistory/view.jsx b/ui/component/walletFiatPaymentHistory/view.jsx index c1a45965e..c6cba4744 100644 --- a/ui/component/walletFiatPaymentHistory/view.jsx +++ b/ui/component/walletFiatPaymentHistory/view.jsx @@ -22,10 +22,6 @@ const WalletBalance = (props: Props) => { // receive transactions from parent component const { transactions: accountTransactions } = props; - // console.log(accountTransactions.length); - // console.log('wallet transactions length'); - - // const [accountStatusResponse, setAccountStatusResponse] = React.useState(); // const [subscriptions, setSubscriptions] = React.useState(); @@ -101,6 +97,7 @@ const WalletBalance = (props: Props) => { ))} + {/* show some markup if there's no transactions */} {(!accountTransactions || accountTransactions.length === 0) &&

No Transactions

}
diff --git a/ui/page/wallet/view.jsx b/ui/page/wallet/view.jsx index 3987f855b..475085aed 100644 --- a/ui/page/wallet/view.jsx +++ b/ui/page/wallet/view.jsx @@ -122,27 +122,6 @@ const WalletPage = (props: Props) => { const response = await getAccountStatus(); setAccountStatusResponse(response); - - // TODO: some weird naming clash hence getAccountTransactionsa - const getAccountTransactions = await getAccountTransactionsa(); - - setAccountTransactionResponse(getAccountTransactions); - } catch (err) { - console.log(err); - } - })(); - }, []); - - // populate customer payment data - React.useEffect(() => { - (async function() { - try { - // get card payments customer has made - let customerTransactionResponse = await getPaymentHistory(); - - customerTransactionResponse.reverse(); - - setCustomerTransactions(customerTransactionResponse); } catch (err) { console.log(err); } @@ -163,10 +142,11 @@ const WalletPage = (props: Props) => { {__('Balance')} {__('Transactions')} - {__('Subscriptions')} + {/*{__('Subscriptions')}*/} {/*{__('Analytics')}*/} + {/* balances for lbc and fiat */} @@ -194,17 +174,17 @@ const WalletPage = (props: Props) => { - -
- - -
-
- -
-

Coming soon!

-
-
+ {/**/} + {/*
*/} + {/* */} + {/* */} + {/*
*/} + {/*
*/} + {/**/} + {/*
*/} + {/*

Coming soon!

*/} + {/*
*/} + {/*
*/}