Amazing work, we're almost done with this project, the last piece of functionality that we're missing
is the ability to move around our less.
So what I would want is to add reave and buttons.
And then, of course, I'm going to display the next or pref page in my list.
So I'm going to navigate back to my project, scroll down a bit.
And in a B10 container, I don't want to add them here in there or want to add it before and after.
So start with pretty button.
So we just hardcourt the button, will add a class name and the class name will be brief beaten and
then as far as the value we're just going to go with.
Now eventually there's going to be a function that we invoke on Kleck and the name will be Prešov page.
And of course I just need to grab the button that I just created and then scroll past the data and copy
and paste.
Now, of course, we're looking for the values of next and this is going to be the next button as far
as a class and function also will be called next page.
We scroll up and this is going to be very similar to the slider we're setting up where again, I would
want to increase the value by one or decrease the value by one.
But then I also would want to check, well, what is the index?
Because if the index is bigger than my last index, then of course I would want to go back to zero.
And if it's less than zero, then of course I would want to set it up equal to the last index in.
Right.
Otherwise I can keep on clicking Max and Breve and then I'm just going to be showing some gibberish.
So we're going to go to the next page first.
I guess so consed next page and then in here we're going to set the page and I'll pass in my function.
Remember as a value we're getting that old state value.
So this is going to be the current page that I have in state and we're going to set up a new variable
called this next page and that one is equal to the old page plus one.
And before I return anything from my callback function, because I would want to check what is that
value.
So if the next page is bigger than data, then that is important data and then the length minus one.
Awesome.
Then the next page will be equal to zero.
And then remember, whatever, we're returning from the function because that is going to be the value.
So that's why our turn the next page.
Of course I have a big fat complaint because we didn't set up the other function, the prevalence of
go with prev page, still the old page, but will change this value around Prešov page minus one.
And we'll check whether the print page is less than zero.
If every page is less than zero, then of course the value will be equal to the length minus one.
So the last index of the items and we're going to go with Prepackage is equal to data and length and
then minus one.
And then, of course, as far as return go breve, um, on page, we set this up.
And we should also see the brief and next buttons, so I'm going to go to pagination, these are my
pages.
I can probably zoom out a little bit just so I can see a bit better.
And there is now we can go all the way to the end of the era and also the other way as well.
And if we click course, we display that specific page.
Hopefully everyone enjoy the project and I hope the next one.