error boundary and table pagination

This commit is contained in:
Mikola
2024-03-19 16:39:36 +03:00
parent 6afccb19d8
commit 2a5991da1f
5 changed files with 16 additions and 13 deletions

View File

@ -1,5 +1,6 @@
import { getTheme } from "@table-library/react-table-library/baseline";
import { CompactTable } from "@table-library/react-table-library/compact";
import { usePagination } from "@table-library/react-table-library/pagination";
import { useSort } from "@table-library/react-table-library/sort";
import { useTheme } from "@table-library/react-table-library/theme";
import React, { useEffect, useState } from "react";
@ -14,7 +15,6 @@ import { Loader } from "@components/Common/Loader/Loader";
import { Navigation } from "@components/Navigation/Navigation";
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
import { usePagination } from "@table-library/react-table-library/pagination";
import rightArrow from "assets/icons/arrows/arrowRight.svg";
@ -105,7 +105,7 @@ export const PartnerCategories = () => {
const pagination = usePagination(data, {
state: {
page: 0,
size: 5,
size: 5
}
});
@ -270,7 +270,9 @@ export const PartnerCategories = () => {
pagination={pagination}
/>
<div className="table__pagination">
<span>Total Pages: {pagination.state.getTotalPages(data.nodes)}</span>
<span>
Total Pages: {pagination.state.getTotalPages(data.nodes)}
</span>
<span className="table__pages">
Page:{" "}
@ -279,7 +281,8 @@ export const PartnerCategories = () => {
key={index}
type="button"
style={{
fontWeight: pagination.state.page === index ? "bold" : "normal",
fontWeight:
pagination.state.page === index ? "bold" : "normal"
}}
onClick={() => pagination.fns.onSetPage(index)}
>