fix: disable pagination nav buttons correctly (#10561)

* fix: update button disabling logic
This commit is contained in:
Michael Smith
2023-11-07 09:36:26 -05:00
committed by GitHub
parent f5c4826e4c
commit b0aa91bf27
@@ -21,14 +21,15 @@ export const PaginationWidgetBase = ({
}: PaginationWidgetBaseProps): JSX.Element | null => {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("md"));
const numPages = Math.ceil(count / limit);
const isFirstPage = page === 0;
const isLastPage = page === numPages - 1;
const numPages = Math.ceil(count / limit);
if (numPages < 2) {
return null;
}
const isFirstPage = page <= 1;
const isLastPage = page >= numPages;
return (
<div
css={{