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 { faCheck, faChevronDown } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { useStopWheelScroll } from "src/utils/form";
|
import { useStopWheelScroll } from "src/utils/form";
|
||||||
import { Placement } from "react-bootstrap/esm/Overlay";
|
import { Placement } from "react-bootstrap/esm/Overlay";
|
||||||
|
import { PatchComponent } from "src/patch";
|
||||||
|
|
||||||
const PageCount: React.FC<{
|
const PageCount: React.FC<{
|
||||||
totalPages: number;
|
totalPages: number;
|
||||||
@@ -158,7 +159,9 @@ interface IPaginationIndexProps {
|
|||||||
|
|
||||||
const minPagesForCompact = 4;
|
const minPagesForCompact = 4;
|
||||||
|
|
||||||
export const Pagination: React.FC<IPaginationProps> = ({
|
export const Pagination: React.FC<IPaginationProps> = PatchComponent(
|
||||||
|
"Pagination",
|
||||||
|
({
|
||||||
itemsPerPage,
|
itemsPerPage,
|
||||||
currentPage,
|
currentPage,
|
||||||
totalItems,
|
totalItems,
|
||||||
@@ -235,15 +238,12 @@ export const Pagination: React.FC<IPaginationProps> = ({
|
|||||||
</Button>
|
</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
);
|
||||||
|
|
||||||
export const PaginationIndex: React.FC<IPaginationIndexProps> = ({
|
export const PaginationIndex: React.FC<IPaginationIndexProps> = PatchComponent(
|
||||||
loading,
|
"PaginationIndex",
|
||||||
itemsPerPage,
|
({ loading, itemsPerPage, currentPage, totalItems, metadataByline }) => {
|
||||||
currentPage,
|
|
||||||
totalItems,
|
|
||||||
metadataByline,
|
|
||||||
}) => {
|
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
if (loading) return null;
|
if (loading) return null;
|
||||||
@@ -268,4 +268,5 @@ export const PaginationIndex: React.FC<IPaginationIndexProps> = ({
|
|||||||
{metadataByline}
|
{metadataByline}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user