diff --git a/scm-ui-components/packages/ui-components/src/LinkPaginator.js b/scm-ui-components/packages/ui-components/src/LinkPaginator.js index 4e21033f93..aaf13d7b15 100644 --- a/scm-ui-components/packages/ui-components/src/LinkPaginator.js +++ b/scm-ui-components/packages/ui-components/src/LinkPaginator.js @@ -3,16 +3,16 @@ import React from "react"; import {translate} from "react-i18next"; import type {PagedCollection} from "@scm-manager/ui-types"; import {Button} from "./buttons"; -import {withRouter} from "react-router-dom"; type Props = { collection: PagedCollection, - t: string => string, - match: any + page: number, + + // context props + t: string => string }; class LinkPaginator extends React.Component { - //TODO: HATEOAS-Links verwenden renderFirstButton() { return ( @@ -26,30 +26,32 @@ class LinkPaginator extends React.Component { } renderPreviousButton(label?: string) { - const { match } = this.props; - const page = parseInt(match.params.page) || 1; + const { page } = this.props; const previousPage = page - 1; return (