Skip to content

Commit 77d4ede

Browse files
committed
fix(unity-react-core): change pagination ellipses and display
1 parent 171ea80 commit 77d4ede

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/unity-react-core/src/components/Pagination/Pagination.jsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,28 @@ export const Pagination = ({
6161
};
6262

6363
const renderPages = () => {
64+
65+
if (totalPages < 5) {
66+
return (
67+
<>
68+
{Array.from({ length: totalPages }, (_, index) => {
69+
const page = index + 1;
70+
return (
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+
6486
// Set the ranges to be shown in the pagination
6587
const displayMinimumPages = 2;
6688
const lowerRangeLimit = iff(

0 commit comments

Comments
 (0)