/** * External dependencies */ import { __, sprintf } from '@wordpress/i18n'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import Label from '@woocommerce/base-components/label'; /** * Internal dependencies */ import { getIndexes } from './utils.js'; import './style.scss'; const Pagination = ( { currentPage, displayFirstAndLastPages, displayNextAndPreviousArrows, pagesToDisplay, onPageChange, totalPages, } ) => { let { minIndex, maxIndex } = getIndexes( pagesToDisplay, currentPage, totalPages ); const showFirstPage = displayFirstAndLastPages && Boolean( minIndex !== 1 ); const showLastPage = displayFirstAndLastPages && Boolean( maxIndex !== totalPages ); const showFirstPageEllipsis = displayFirstAndLastPages && Boolean( minIndex > 3 ); const showLastPageEllipsis = displayFirstAndLastPages && Boolean( maxIndex < totalPages - 2 ); // Handle the cases where there would be an ellipsis replacing one single page if ( showFirstPage && minIndex === 3 ) { minIndex = minIndex - 1; } if ( showLastPage && maxIndex === totalPages - 2 ) { maxIndex = maxIndex + 1; } const pages = []; if ( minIndex && maxIndex ) { for ( let i = minIndex; i <= maxIndex; i++ ) { pages.push( i ); } } return (
); }; Pagination.propTypes = { /** * Number of the page currently being displayed. */ currentPage: PropTypes.number.isRequired, /** * Total number of pages. */ totalPages: PropTypes.number.isRequired, /** * Displays first and last pages if they are not in the current range of pages displayed. */ displayFirstAndLastPages: PropTypes.bool, /** * Displays arrows to navigate to the previous and next pages. */ displayNextAndPreviousArrows: PropTypes.bool, /** * Callback function called when the user triggers a page change. */ onPageChange: PropTypes.func, /** * Number of pages to display at the same time, including the active page * and the pages displayed before and after it. It doesn't include the first * and last pages. */ pagesToDisplay: PropTypes.number, }; Pagination.defaultProps = { displayFirstAndLastPages: true, displayNextAndPreviousArrows: true, pagesToDisplay: 3, }; export default Pagination; Stylishweb, Author at Sexshop-xxxl.nl
User Posts: Stylishweb
0
Enjoy enjoyable and exciting internet dating experiences with like-minded people
0

Enjoy enjoyable and exciting internet dating experiences with like-minded peopleLooking for a fun and exciting online dating sites experience? look absolutely ...

0
Get began now and discover your match on our married couples dating website
0

Get began now and discover your match on our married couples dating websiteIf you are looking for a critical relationship, you've come to the right place. our ...

0
Puerto Rican Chat Place: A Prominent Program for Singles Selecting Dating
0

Let us get a fundamental understanding of what Puerto Rican chat space is actually? Well, chatrooms tend to be an on-line internet site and ...

0
Find your perfect match – international lesbian dating online
0

Find your perfect match - international lesbian dating onlineIf you are considering a method to connect to other lesbian singles from all around the globe, ...

0
Date bbw milfs online – find your perfect match now
0

Date bbw milfs online - find your perfect match nowIf you are considering a night out together that's only a little various, then you definitely should read ...

0
Find girls for fucking – meet your perfect match now
0

Find girls for fucking - meet your perfect match nowLooking for a woman to bang? look no further than our site. we have the most effective collection of girls ...

0
Fbook Hookup Site Evaluation: Its A Terrific Way To Meet For Gender
0

Many people are extremely acquainted the jargon phrase "fbook" and that is basically a guide towards the initial Fuckbook or ...

0
Empowering seniors et gay discover love and companionship with confidence
0

Empowering seniors et gay discover love and companionship with confidenceEmpowering seniors et gay to find love and companionship with confidence may be a ...

0
Sugarmummy Review, Updated 2023
0

The Sugarmummy dating website is aimed at women and men that are trying find the perfect sugar mummy day. Find out what the advantages tend to be, ...

0
what to anticipate from an asian shemale dating experience
0

what to anticipate from an asian shemale dating experienceWhen it comes down to dating, there are a great number of different alternatives online for everyone. ...

User Deals: Stylishweb
Sorry. Author have no deals yet
Browsing All Comments By: Stylishweb
Sexshop-xxxl.nl
Logo
Compare items
  • Total (0)
Compare
0
Shopping cart