mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Support patching Pagination and PaginationIndex (#5957)
This commit is contained in:
@@ -14,6 +14,7 @@ import { Icon } from "../Shared/Icon";
|
||||
import { faCheck, faChevronDown } from "@fortawesome/free-solid-svg-icons";
|
||||
import { useStopWheelScroll } from "src/utils/form";
|
||||
import { Placement } from "react-bootstrap/esm/Overlay";
|
||||
import { PatchComponent } from "src/patch";
|
||||
|
||||
const PageCount: React.FC<{
|
||||
totalPages: number;
|
||||
@@ -158,13 +159,15 @@ interface IPaginationIndexProps {
|
||||
|
||||
const minPagesForCompact = 4;
|
||||
|
||||
export const Pagination: React.FC<IPaginationProps> = ({
|
||||
export const Pagination: React.FC<IPaginationProps> = PatchComponent(
|
||||
"Pagination",
|
||||
({
|
||||
itemsPerPage,
|
||||
currentPage,
|
||||
totalItems,
|
||||
onChangePage,
|
||||
pagePopupPlacement,
|
||||
}) => {
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const totalPages = useMemo(
|
||||
() => Math.ceil(totalItems / itemsPerPage),
|
||||
@@ -235,15 +238,12 @@ export const Pagination: React.FC<IPaginationProps> = ({
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
);
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
export const PaginationIndex: React.FC<IPaginationIndexProps> = ({
|
||||
loading,
|
||||
itemsPerPage,
|
||||
currentPage,
|
||||
totalItems,
|
||||
metadataByline,
|
||||
}) => {
|
||||
export const PaginationIndex: React.FC<IPaginationIndexProps> = PatchComponent(
|
||||
"PaginationIndex",
|
||||
({ loading, itemsPerPage, currentPage, totalItems, metadataByline }) => {
|
||||
const intl = useIntl();
|
||||
|
||||
if (loading) return null;
|
||||
@@ -268,4 +268,5 @@ export const PaginationIndex: React.FC<IPaginationIndexProps> = ({
|
||||
{metadataByline}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user