Skip to content

Commit d438a71

Browse files
fix: pagination next disabled state, current page style
1 parent bc758d1 commit d438a71

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/pagination.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export function PaginationControls(
3232
props.onLimitChange(newLimit)
3333
}
3434
}
35+
console.log(props.page, props.totalPages)
3536

3637
return (
3738
<div className="flex items-center justify-between">
@@ -80,14 +81,14 @@ export function PaginationControls(
8081
<PaginationItem>
8182
<PaginationNext
8283
onClick={() => {
83-
if (props.page < props.total) {
84+
if (props.page < props.totalPages) {
8485
props.onPageChange(props.page + 1)
8586
}
8687
}}
8788
className={
88-
props.page === props.total
89-
? "pointer-events-none opacity-50"
90-
: "cursor-pointer"
89+
props.page < props.totalPages
90+
? "cursor-pointer"
91+
: "pointer-events-none opacity-50"
9192
}
9293
/>
9394
</PaginationItem>

src/components/ui/pagination.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function PaginationLink({
5858
variant: isActive ? "outline" : "ghost",
5959
size,
6060
}),
61+
isActive ? "dark:bg-border hover:text-inherit" : "",
6162
className
6263
)}
6364
{...props}

0 commit comments

Comments
 (0)