mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Refactor build (#493)
* Add lint/format checks to build * Make travis get full repo to get tags * Run packr2 once in cross-compile * Fix quotes in package.json * Fix linting issues * Formatting * Fix vet issue * Fix go lint issues * Show start of each platform compilation * Add validate target * Set gitattributes for go fmt and mod vendor * Fix tag name * Add fmt-ui target
This commit is contained in:
@@ -13,7 +13,6 @@ interface IPaginationIndexProps {
|
||||
itemsPerPage: number;
|
||||
currentPage: number;
|
||||
totalItems: number;
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
||||
export const Pagination: React.FC<IPaginationProps> = ({
|
||||
@@ -112,14 +111,25 @@ export const PaginationIndex: React.FC<IPaginationIndexProps> = ({
|
||||
itemsPerPage,
|
||||
currentPage,
|
||||
totalItems,
|
||||
onClick
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
// Build the pagination index string
|
||||
const firstItemCount:number = Math.min((currentPage-1)*itemsPerPage+1, totalItems);
|
||||
const lastItemCount:number = Math.min(firstItemCount+(itemsPerPage-1), totalItems);
|
||||
const indexText:string = `${intl.formatNumber(firstItemCount)}-${intl.formatNumber(lastItemCount)} of ${intl.formatNumber(totalItems)}`;
|
||||
const firstItemCount: number = Math.min(
|
||||
(currentPage - 1) * itemsPerPage + 1,
|
||||
totalItems
|
||||
);
|
||||
const lastItemCount: number = Math.min(
|
||||
firstItemCount + (itemsPerPage - 1),
|
||||
totalItems
|
||||
);
|
||||
const indexText: string = `${intl.formatNumber(
|
||||
firstItemCount
|
||||
)}-${intl.formatNumber(lastItemCount)} of ${intl.formatNumber(totalItems)}`;
|
||||
|
||||
return <span className="filter-container text-muted paginationIndex" onClick={onClick}>{indexText}</span>
|
||||
};
|
||||
return (
|
||||
<span className="filter-container text-muted paginationIndex">
|
||||
{indexText}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user