@times-components/pagination

3.13.20 • Public • Published

Pagination

The pagination package provides a pagination user interface (UI) and pagination state Higher Order Component (HOC). These two exports are both required for pagination to work. This package is currently only used by article list pages (author profile and topics) for the web.

UI

The <Pagination /> component provides a pagination UI for web. The user can see what page they are on, and can navigate to other pages with the next and previous buttons. This UI component ships with its own tracking handling.

State management with a HOC

withPageState is a HOC pagination helper that manages the state of the pagination. It maintains what page the user is currently on. Typically this is passed a component that consumes the Pagination component itself.

Usage

withPageState(authorProfileTrackingContext(AuthorProfile));

Contributing

Please read CONTRIBUTING.md before contributing to this package

Running the code

Please see our main README.md to get the project running locally

Development

The code can be formatted and linted in accordance with the agreed standards.

yarn fmt
yarn lint

Testing

This package uses yarn (latest) to run unit tests on each platform with jest.

yarn test:web

Visit the official storybook to see our available pagination templates.

Package Sidebar

Install

npm i @times-components/pagination

Weekly Downloads

133

Version

3.13.20

License

BSD-3-Clause

Unpacked Size

210 kB

Total Files

16

Last publish

Collaborators

  • marcincuber
  • newsuk
  • news-tools