mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
fix: disable pagination nav buttons correctly (#10561)
* fix: update button disabling logic
This commit is contained in:
@@ -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={{
|
||||
|
||||
Reference in New Issue
Block a user