Skip to content

Commit df6406b

Browse files
authored
Merge pull request #1274 from andypols/fix-empty-pagination
fix: empty pagination
2 parents 93704e6 + 1b9a0ef commit df6406b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/ui/components/Pagination/Pagination.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.paginationContainer {
22
display: flex;
33
justify-content: center;
4+
align-items: center;
45
padding: 1rem;
56
margin-top: 20px;
67
gap: 10px;
@@ -17,10 +18,18 @@
1718
transition: background-color 0.3s ease;
1819
}
1920

20-
.pageButton:hover {
21+
.pageButton:hover:not(:disabled) {
2122
background-color: #e2e6ea;
2223
}
2324

25+
.pageButton:disabled {
26+
background-color: #e9ecef;
27+
color: #6c757d;
28+
border-color: #dee2e6;
29+
cursor: not-allowed;
30+
opacity: 0.6;
31+
}
32+
2433
.activeButton {
2534
background-color: #007bff;
2635
color: #fff;

src/ui/components/Pagination/Pagination.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ const Pagination: React.FC<PaginationProps> = ({
3232
Previous
3333
</button>
3434

35-
<span>
36-
Page {currentPage} of {totalPages}
37-
</span>
35+
<span>Page {totalPages === 0 ? '0 of 0' : `${currentPage} of ${totalPages}`}</span>
3836

3937
<button
4038
className='pageButton'

0 commit comments

Comments
 (0)