fix: remove mui components from <PaginationWidgetBase /> (#22237)

This commit is contained in:
Jake Howell
2026-02-23 22:25:13 +11:00
committed by GitHub
parent b776a14b46
commit e9b66a8083
2 changed files with 4 additions and 8 deletions
@@ -1,5 +1,3 @@
import { useTheme } from "@emotion/react";
import useMediaQuery from "@mui/material/useMediaQuery";
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
import type { FC } from "react";
import { NumberedPageButton, PlaceholderPageButton } from "./PageButtons";
@@ -24,8 +22,6 @@ export const PaginationWidgetBase: FC<PaginationWidgetBaseProps> = ({
hasPreviousPage,
hasNextPage,
}) => {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("md"));
const totalPages = Math.ceil(totalRecords / pageSize);
if (totalPages < 2) {
@@ -52,19 +48,20 @@ export const PaginationWidgetBase: FC<PaginationWidgetBaseProps> = ({
<ChevronLeftIcon />
</PaginationNavButton>
{isMobile ? (
<div className="contents md:hidden">
<NumberedPageButton
highlighted
pageNumber={currentPage}
totalPages={totalPages}
/>
) : (
</div>
<div className="hidden md:contents">
<PaginationRow
currentPage={currentPage}
totalPages={totalPages}
onChange={onPageChange}
/>
)}
</div>
<PaginationNavButton
disabled={isNextDisabled}
-1
View File
@@ -177,7 +177,6 @@ export default defineConfig({
"@mui/material/ToggleButton",
"@mui/material/ToggleButtonGroup",
"@mui/material/styles",
"@mui/material/useMediaQuery",
"@mui/system/createTheme",
"@mui/system/useTheme",
"@mui/x-tree-view",