一覧へ戻る
mate-academy/react_pagination(新しいタブで開きます)
主要言語: JavaScript
- star 数
- 8
- watcher 数
- 8
- fork 数
- 1,733
- issue 数
- 1,404
- 最終更新
- 2024/09/26
主要言語: JavaScript
Here is the working version
You a given a list of items and markup for the Pagination. Implement the
Pagination as a stateless component to show only the items for a current page.
Pagination should be used with the next props:
<Pagination total={42} // total number of items to paginate perPage={5} // number of items per page currentPage={1} /* optional with 1 by default */ onPageChange={(page) => { ... }} />
data-cy attributes;total and perPageli.active;onPageChange callback should be triggered only if page was changed;App should listen to the onPageChange and save a new page;« and » links should open the prev and the next pages accordingly
li.disabled and a[aria-disabled="true"])data-cy="info" in the next format Page 1 (items 1 - 5 of 42);<select data-cy="perPageSelector"> with 3, 5, 10, 20 options to change the perPage;
perPage;?page=2&perPage=7 in the URL and apply them on page loadnpm test to ensure your solution is correct.<your_account> with your Github username in the DEMO LINK and add it to the PR description.