From 6f26e2e88ff23fd0dfa50f4ba00fb3f5fd86078a Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Tue, 20 Jun 2023 15:50:47 +0100 Subject: [PATCH] history layout changed --- src/components/History/index.jsx | 78 ++++++++++++------- .../WalletComponent/PurchasesTable.jsx | 6 +- .../WalletComponent/RecentActivityTable.jsx | 2 +- 3 files changed, 56 insertions(+), 30 deletions(-) diff --git a/src/components/History/index.jsx b/src/components/History/index.jsx index 9386635..2fec60b 100644 --- a/src/components/History/index.jsx +++ b/src/components/History/index.jsx @@ -13,7 +13,9 @@ import LoadingSpinner from "../Spinners/LoadingSpinner"; export default function History() { - const apiCall = new usersService() + const apiCall = new usersService() + + let [tab, setTab] = useState("purchases"); //STATE FOR SWITCHING BETWEEN TABS let [paymentHistory, setPaymentHistory] = useState({ // FOR PAYMENT HISTORY loading: true, @@ -63,7 +65,7 @@ export default function History() { <>
-
+

@@ -213,33 +215,57 @@ export default function History() { {/*

*/} {/**/} {/* */} -
- {/* PURCHASE SECTION */} -
-
-

Purchases

- {purchaseHistory.loading ? - - : - - } -
+
+ {/* switch button */} +
+ +
- {/* END OF PURCHASE SECTION */} - - {/* RECENT ACTIVITY SECTION */} -
-
-

Recent Activity

- {/*

Activity Report

*/} - {paymentHistory.loading ? - - : - + {/* END OF switch button */} +
+ {/* PURCHASE SECTION */} + {tab == 'purchases' && +
+

Purchases

+ {purchaseHistory.loading ? + + : + + } +
} -
+ {/* END OF PURCHASE SECTION */} + + {/* RECENT ACTIVITY SECTION */} + {tab == 'recent' && +
+

Recent Activity

+ {/*

Activity Report

*/} + {paymentHistory.loading ? + + : + + } +
+ } + {/* END OF RECENT ACTIVITY SECTION */}
- {/* END OF RECENT ACTIVITY SECTION */}
{/**/}
diff --git a/src/components/MyWallet/WalletComponent/PurchasesTable.jsx b/src/components/MyWallet/WalletComponent/PurchasesTable.jsx index 1295ec5..c8635a7 100644 --- a/src/components/MyWallet/WalletComponent/PurchasesTable.jsx +++ b/src/components/MyWallet/WalletComponent/PurchasesTable.jsx @@ -15,11 +15,11 @@ function PurchasesTable({purchase}) { } return ( -
+
- + @@ -29,7 +29,7 @@ function PurchasesTable({purchase}) { {currentPurchase.map((item, index) => ( - diff --git a/src/components/MyWallet/WalletComponent/RecentActivityTable.jsx b/src/components/MyWallet/WalletComponent/RecentActivityTable.jsx index 1e1a842..bb57e5e 100644 --- a/src/components/MyWallet/WalletComponent/RecentActivityTable.jsx +++ b/src/components/MyWallet/WalletComponent/RecentActivityTable.jsx @@ -15,7 +15,7 @@ function RecentActivityTable({payment}) { } return ( -
+
Trx.Trx. Amount Fee
{item.added_date}
+
{item.added_date}
{item.confirmation}
{item.amount}
-- 2.34.1