Git Product home page Git Product logo

react-sanity-pagination's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-sanity-pagination's Issues

output isn't semantic.

The output this generates is an unordered list with a bunch of nested buttons. Each button should be within a list-item.

current output:

<ul class="pagePagination">
  <button class="paginateButton paginationPrev">⬅️</button>
  <button class="">1</button>
  <button class="">2</button>
  <button class="">3</button>
  <button class="active">4</button>
  <button class="paginateButton paginationNext" disabled="">➡️</button>
</ul>

Should be:

<ul class="pagePagination">
  <li><button class="paginateButton paginationPrev">⬅️</button></li>
  <li><button class="">1</button></li>
  <li><button class="">2</button></li>
  <li><button class="">3</button></li>
  <li><button class="active">4</button></li>
  <li><button class="paginateButton paginationNext" disabled="">➡️</button></li>
</ul>

Pagiantion button not calculated automatically

function BlogDsList() {
const postsPerPage = 4;
const [items, setItems] = useState([]);
useEffect(() => {
client.fetch(*[_type == 'post' && topic =='ds']{ ..., author->, categories[]-> } | order(_createdAt )).then(res => {
itemsToSend.push(...res);
});
}, []);
const action = (page, range, items) => {
console.log(Page: ${page} 📃, Range: ${range} 🚀, Items: ${items} 🌀);
setItems(items);
};

return (

<div className="paginationContent">
  {items.map((post) => {
    return <div key={post._id} className='mt-5 pl-8 cursor-pointer hover:bg-gray-200 p-2 flex flex-col shadow-md rounded-md bg-gray-100 '>

{post._updatedAt}

{post.title}

{post.description}

Read Post
; })}
{/* Props required: action, postsPerPage, postsLength */}
<Pagination
    paginationStyle={"centerMode"}
    items={itemsToSend}
    action={action}
    postsPerPage={postsPerPage}
    nextButton={true}
    prevButton={true}
    nextButtonLabel={"👉🏻"}
    prevButtonLabel={"👈🏻"}
  />
) } I have this above component That shows some post.But in my case pagination button are not calculated perfectly example i have 8 post if i want that 4 post should be render in one page so the total page should be 2(max) it can't go beyond that but in my case i have 4 tab some repeated data shows. Please help me out 🙏🏻

Pagination Dots

Explore implementing pagination dots where certain page buttons get hidden if the list of pages is too long.

Example: 1 2 3 ... 6 7 8

React 18

Hi

Is is possible to upgrade it to react 18 ?
Or is there a work around it

Thank you
Regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.