IO-747 Update CCC auto pagination

This commit is contained in:
Patrick Fic
2021-03-09 09:27:14 -08:00
parent 43c771b4f6
commit 0ab019b9f7

View File

@@ -160,11 +160,13 @@ export default function ContractsJobsComponent({
);
const defaultCurrent = useMemo(() => {
return (
Math.round(
((filteredData.findIndex((v) => v.id === selectedJob) || 0) + 1) / 10
) + 1
);
const page =
Math.floor(
(filteredData.findIndex((v) => v.id === selectedJob) || 0) / 3
) + 1;
console.log("Page", page);
return page;
}, [filteredData, selectedJob]);
if (loading) return <LoadingSkeleton />;
@@ -181,6 +183,7 @@ export default function ContractsJobsComponent({
size="small"
pagination={{
position: "top",
defaultPageSize: 3,
defaultCurrent: defaultCurrent,
}}
columns={columns}