Skip to content

Commit b0aa91b

Browse files
authored
fix: disable pagination nav buttons correctly (#10561)
* fix: update button disabling logic
1 parent f5c4826 commit b0aa91b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

site/src/components/PaginationWidget/PaginationWidgetBase.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ export const PaginationWidgetBase = ({
2121
}: PaginationWidgetBaseProps): JSX.Element | null => {
2222
const theme = useTheme();
2323
const isMobile = useMediaQuery(theme.breakpoints.down("md"));
24-
const numPages = Math.ceil(count / limit);
25-
const isFirstPage = page === 0;
26-
const isLastPage = page === numPages - 1;
2724

25+
const numPages = Math.ceil(count / limit);
2826
if (numPages < 2) {
2927
return null;
3028
}
3129

30+
const isFirstPage = page <= 1;
31+
const isLastPage = page >= numPages;
32+
3233
return (
3334
<div
3435
css={{

0 commit comments

Comments
 (0)