Task page fix #626
@@ -1,5 +1,4 @@
|
||||
import { useMemo, useState } from "react";
|
||||
import localImgLoad from "../../../lib/localImgLoad";
|
||||
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
||||
import { PaginatedList, handlePagingFunc } from "../../Pagination";
|
||||
import PendingJobsPopout from "../../jobPopout/PendingJobsPopout";
|
||||
@@ -14,10 +13,10 @@ export default function FamilyPending({
|
||||
|
||||
let filteredFamilyData = useMemo(
|
||||
() =>
|
||||
familyData?.result_list?.filter(
|
||||
familyData?.filter(
|
||||
(data) => data?.family_uid === accountDetails?.family_uid
|
||||
),
|
||||
[accountDetails?.family_uid, familyData?.result_list]
|
||||
[accountDetails?.family_uid, familyData]
|
||||
);
|
||||
|
||||
const [currentPage, setCurrentPage] = useState(0);
|
||||
@@ -25,7 +24,7 @@ export default function FamilyPending({
|
||||
const indexOfFirstItem = Number(currentPage);
|
||||
const indexOfLastItem =
|
||||
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||
const currentPendingTasks = filteredFamilyData?.slice(
|
||||
const currentPendingTasks = familyData?.slice(
|
||||
indexOfFirstItem,
|
||||
indexOfLastItem
|
||||
);
|
||||
@@ -34,13 +33,14 @@ export default function FamilyPending({
|
||||
handlePagingFunc(e, setCurrentPage);
|
||||
};
|
||||
|
||||
console.log(familyData);
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full p-3 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow lg:min-h-[538px] ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
{filteredFamilyData && (
|
||||
{familyData && (
|
||||
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<tbody>
|
||||
@@ -54,7 +54,11 @@ export default function FamilyPending({
|
||||
value?.currency_code,
|
||||
value?.currency
|
||||
);
|
||||
let image = `${familyData.session_image_server}${localStorage.getItem('session_token')}/job/${value.job_uid}`
|
||||
let image = `${
|
||||
familyData.session_image_server
|
||||
}${localStorage.getItem("session_token")}/job/${
|
||||
value.job_uid
|
||||
}`;
|
||||
return (
|
||||
<tr
|
||||
key={index}
|
||||
@@ -136,8 +140,8 @@ export default function FamilyPending({
|
||||
<PaginatedList
|
||||
onClick={handlePagination}
|
||||
prev={currentPage == 0}
|
||||
next={currentPage + itemsPerPage >= filteredFamilyData.length}
|
||||
data={filteredFamilyData}
|
||||
next={currentPage + itemsPerPage >= familyData.length}
|
||||
data={familyData}
|
||||
start={indexOfFirstItem}
|
||||
stop={indexOfLastItem}
|
||||
/>
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function FamilyNewTasks({
|
||||
const handlePagination = (e) => handlePagingFunc(e, setCurrentPage);
|
||||
|
||||
console.log(familyData)
|
||||
console.log(typeof familyData?.length)
|
||||
console.log(typeof familyData)
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full bg-white dark:bg-dark-white h-full lg:min-h-[538px] overflow-hidden rounded-2xl section-shadow p-3 ${
|
||||
|
||||
Reference in New Issue
Block a user