coming along well

This commit is contained in:
Anthony 2021-08-19 19:41:58 +02:00
parent 32e6762ba8
commit 8c9af6aa1d
No known key found for this signature in database
GPG key ID: C386D3C93D50E356
4 changed files with 23 additions and 43 deletions

View file

@ -104,7 +104,9 @@ function TxoList(props: Props) {
// console.log('amount of transactions');
// console.log(customerTransactionResponse.length);
if(customerTransactionResponse && customerTransactionResponse.length){
customerTransactionResponse.reverse();
}
setCustomerTransactions(customerTransactionResponse);
} catch (err) {
@ -477,8 +479,9 @@ function TxoList(props: Props) {
</div>
</div>
{/* listing of the transactions */}
{ fiatType === 'incoming' && <WalletFiatPaymentHistory transactions={accountTransactionResponse} /> }
{ fiatType === 'outgoing' && <WalletFiatAccountHistory transactions={customerTransactions} /> }
{ fiatType === 'incoming' && <WalletFiatAccountHistory transactions={accountTransactionResponse} /> }
{ fiatType === 'outgoing' && <WalletFiatPaymentHistory transactions={customerTransactions} /> }
{/* TODO: have to finish pagination */}
<Paginate totalPages={Math.ceil(txoItemCount / Number(pageSize))} />
</div>
</div>

View file

@ -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 (
<div className="table__wrapper">

View file

@ -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) => {
))}
</tbody>
</table>
{/* show some markup if there's no transactions */}
{(!accountTransactions || accountTransactions.length === 0) && <p style={{textAlign: 'center', marginTop: '20px', fontSize: '13px', color: 'rgb(171, 171, 171)'}}>No Transactions</p>}
</div>
</div>

View file

@ -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) => {
<TabList className="tabs__list--collection-edit-page">
<Tab>{__('Balance')}</Tab>
<Tab>{__('Transactions')}</Tab>
<Tab>{__('Subscriptions')}</Tab>
{/*<Tab>{__('Subscriptions')}</Tab>*/}
{/*<Tab>{__('Analytics')}</Tab>*/}
</TabList>
<TabPanels>
{/* balances for lbc and fiat */}
<TabPanel>
<WalletBalance />
</TabPanel>
@ -194,17 +174,17 @@ const WalletPage = (props: Props) => {
</div>
</div>
</TabPanel>
<TabPanel>
<div className="section card-stack">
<WalletFiatPaymentHistory transactions={customerTransactions} />
<WalletFiatAccountHistory transactions={accountTransactionResponse} />
</div>
</TabPanel>
<TabPanel>
<div className="section card-stack">
<h2> Coming soon! </h2>
</div>
</TabPanel>
{/*<TabPanel>*/}
{/* <div className="section card-stack">*/}
{/* <WalletFiatPaymentHistory transactions={customerTransactions} />*/}
{/* <WalletFiatAccountHistory transactions={accountTransactionResponse} />*/}
{/* </div>*/}
{/*</TabPanel>*/}
{/*<TabPanel>*/}
{/* <div className="section card-stack">*/}
{/* <h2> Coming soon! </h2>*/}
{/* </div>*/}
{/*</TabPanel>*/}
</TabPanels>
</Tabs>
</Page>