We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 171ea80 commit 77d4edeCopy full SHA for 77d4ede
packages/unity-react-core/src/components/Pagination/Pagination.jsx
@@ -61,6 +61,28 @@ export const Pagination = ({
61
};
62
63
const renderPages = () => {
64
+
65
+ if (totalPages < 5) {
66
+ return (
67
+ <>
68
+ {Array.from({ length: totalPages }, (_, index) => {
69
+ const page = index + 1;
70
71
+ <PageItem
72
+ ariaLabel={`Page ${page} of ${totalPages}`}
73
+ isClickeable
74
+ key={page}
75
+ selectedPage={selectedPage === page}
76
+ onClick={e => handleChangePage(e, page)}
77
+ >
78
+ {page}
79
+ </PageItem>
80
+ );
81
+ })}
82
+ </>
83
84
+ }
85
86
// Set the ranges to be shown in the pagination
87
const displayMinimumPages = 2;
88
const lowerRangeLimit = iff(
0 commit comments