diff --git a/.env b/.env index 9cf6e84..3efdd7a 100644 --- a/.env +++ b/.env @@ -28,5 +28,8 @@ REACT_APP_FLUTTERWAVE_APIKEY=FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X # Had to change the error time to 3sec cause it took too long REACT_APP_RESET_START_ERROR_TIMEOUT=3000 +#NUMBER OF ITEMS PER PAGE +REACT_APP_ITEM_PER_PAGE=5 + #apigate.lotus.g1.wrenchboard.com:76.209.103.227 #apigate.orion.g1.wrenchboard.com:76.209.103.227 diff --git a/.env.development b/.env.development index 9cf6e84..3efdd7a 100644 --- a/.env.development +++ b/.env.development @@ -28,5 +28,8 @@ REACT_APP_FLUTTERWAVE_APIKEY=FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X # Had to change the error time to 3sec cause it took too long REACT_APP_RESET_START_ERROR_TIMEOUT=3000 +#NUMBER OF ITEMS PER PAGE +REACT_APP_ITEM_PER_PAGE=5 + #apigate.lotus.g1.wrenchboard.com:76.209.103.227 #apigate.orion.g1.wrenchboard.com:76.209.103.227 diff --git a/.env.poduction b/.env.poduction index e20588e..6d4177b 100644 --- a/.env.poduction +++ b/.env.poduction @@ -28,5 +28,8 @@ REACT_APP_FLUTTERWAVE_APIKEY=FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X # Had to change the error time to 3sec cause it took too long REACT_APP_RESET_START_ERROR_TIMEOUT=3000 +#NUMBER OF ITEMS PER PAGE +REACT_APP_ITEM_PER_PAGE=5 + #apigate.orion.g1.wrenchboard.com:76.209.103.227 #apigate.orion.g1.wrenchboard.com:76.209.103.227 diff --git a/src/components/History/HistoryTable.jsx b/src/components/History/HistoryTable.jsx index 7a203f9..b4642b2 100644 --- a/src/components/History/HistoryTable.jsx +++ b/src/components/History/HistoryTable.jsx @@ -5,9 +5,24 @@ import dataImage3 from "../../assets/images/data-table-user-3.png"; import dataImage4 from "../../assets/images/data-table-user-4.png"; import SelectBox from "../Helpers/SelectBox"; +import PaginatedList from "../Pagination/PaginatedList"; +import { handlePagingFunc } from "../Pagination/HandlePagination"; + export default function HistoryTable({ className }) { const filterCategories = ["All Categories", "Explore", "Featured"]; const [selectedCategory, setCategory] = useState(filterCategories[0]); + + let data = ['1', '2', '3', '4', '5', '6'] // to be replaced later by result from API CALL + + const [currentPage, setCurrentPage] = useState(0); + const indexOfFirstItem = Number(currentPage); + const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE); + const currentTask = data.slice(indexOfFirstItem, indexOfLastItem); + + const handlePagination = (e) => { + handlePagingFunc(e,setCurrentPage) + } + return (
+ {data.length &&|
+
+
+
+
+
+
+ + Mullican Computer Joy ++ + Owned by Xoeyam + + |
+
+
+
+
+
+
+ 7473 ETH
+
+
+ |
+
+
+
+
+
+
+ 6392.99$
+
+
+ |
+ + + -24.75 (11.5%) + + | ++ + 343 + + | ++ + 2 Hours 1 min 30s + + | ++ + | +
|
+
+
+
+
+
+
+ + Mullican Computer Joy ++ + Owned by Xoeyam + + |
+
+
+
+
+
+
+ 7473 ETH
+
+
+ |
+
+
+
+
+
+
+ 6392.99$
+
+
+ |
+ + + -24.75 (11.5%) + + | ++ + 343 + + | ++ + 2 Hours 1 min 30s + + | ++ + | +
|
+
+
+
+
+
+
+ + Mullican Computer Joy ++ + Owned by Xoeyam + + |
+
+
+
+
+
+
+ 7473 ETH
+
+
+ |
+
+
+
+
+
+
+ 6392.99$
+
+
+ |
+ + + -24.75 (11.5%) + + | ++ + 343 + + | ++ + 2 Hours 1 min 30s + + | ++ + | +
| @@ -1057,10 +1462,15 @@ export default function HistoryTable({ className }) { |
|
-
-
-
-
-
+ currentActiveJobList.map((value, index) => (
+ - {value.title} --
- {value.description}
-
-
- Price: {value.price*0.01}
-
-
- Duration: {value.timeline_days} day(s)
-
-
- Expire: {value.expire}
-
-
+ |
+
+
+
-
+
+
+
- + {value.title} ++
+ {value.description}
+
+
+ Price: {value.price*0.01}
+
+
+ Duration: {value.timeline_days} day(s)
+
+
+ Expire: {value.expire}
+
+
-
- |
-
+
+ |
+ |
|
-
-
-
-
-
-
- - {value.title} --
- {value.description}
-
-
- Price: {value.price*0.01}
-
-
- Duration: {value.timeline_days} day(s)
-
- |
+ currentJobList.map((value, index) => (
+ |
|
+
+
+
+
+
+
+ + {value.title} ++
+ {value.description}
+
+
+ Price: {value.price*0.01}
+
+
+ Duration: {value.timeline_days} day(s)
+
+ |
- - - | -+ + | + ))} @@ -95,7 +106,12 @@ export default function MyJobTable({MyJobList, className }) { )}
|
+
+
+
+
+
+
+ + Mullican Computer Joy ++ + Owned by Xoeyam + + |
+
+
+
+
+
+
+ 7473 ETH
+
+
+ |
+
+
+
+
+
+
+ 6392.99$
+
+
+ |
+ + + -24.75 (11.5%) + + | ++ + 343 + + | ++ + 2 Hours 1 min 30s + + | ++ + | +
|
+
+
+
+
+
+
+ + Mullican Computer Joy ++ + Owned by Xoeyam + + |
+
+
+
+
+
+
+ 7473 ETH
+
+
+ |
+
+
+
+
+
+
+ 6392.99$
+
+
+ |
+ + + -24.75 (11.5%) + + | ++ + 343 + + | ++ + 2 Hours 1 min 30s + + | ++ + | +
|
+
+
+
+
+
+
+ + Mullican Computer Joy ++ + Owned by Xoeyam + + |
+
+
+
+
+
+
+ 7473 ETH
+
+
+ |
+
+
+
+
+
+
+ 6392.99$
+
+
+ |
+ + + -24.75 (11.5%) + + | ++ + 343 + + | ++ + 2 Hours 1 min 30s + + | ++ + | +
| @@ -1057,10 +1462,15 @@ export default function MyJobTable({ className }) { |
Activity Report
{payment.loading ? @@ -84,7 +84,7 @@ function Balance({wallet, payment, coupon, purchase}) {Activity Report
{payment.loading ? diff --git a/src/components/MyWallet/TransferFund.jsx b/src/components/MyWallet/TransferFund.jsx index 0e32309..551911e 100644 --- a/src/components/MyWallet/TransferFund.jsx +++ b/src/components/MyWallet/TransferFund.jsx @@ -223,7 +223,7 @@ function TransferFund({payment, wallet}) {Activity Report
{payment.loading ? diff --git a/src/components/MyWallet/WalletComponent/CouponTable.jsx b/src/components/MyWallet/WalletComponent/CouponTable.jsx index 29a695c..5993df3 100644 --- a/src/components/MyWallet/WalletComponent/CouponTable.jsx +++ b/src/components/MyWallet/WalletComponent/CouponTable.jsx @@ -1,7 +1,21 @@ -import React from 'react' +import React, {useState} from 'react' + +import PaginatedList from '../../Pagination/PaginatedList' +import { handlePagingFunc } from '../../Pagination/HandlePagination'; function CouponTable({coupon}) { + + const [currentPage, setCurrentPage] = useState(0); + const indexOfFirstItem = Number(currentPage); + const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE); + const currentCoupon = coupon?.data?.slice(indexOfFirstItem, indexOfLastItem); + + const handlePagination = (e) => { + handlePagingFunc(e,setCurrentPage) + } + return ( + <>| {item.added} | {item.code} | @@ -41,6 +55,11 @@ function CouponTable({coupon}) {
| {item.added_date} | {item.confirmation} | @@ -41,6 +55,11 @@ function PurchasesTable({purchase}) {
| {item.trx_date} | @@ -41,6 +55,11 @@ function RecentActivityTable({payment}) { |