And when it comes to Preve Bridge and the next bridge from John is going to be extremely, extremely
similar, the only difference is that in one case, in a brief bridge, we're subtracting one in the
another one, we're adding one and then we'll have to make a decision if we come to the last page or
we come to the first page.
And the way I'll set it up for a brief page will go with let and this is done on purpose.
Your page and your variable will check for state value.
Add or subtract one.
And none will pass in that new bridge into Genge Bridge, just like I said with button container basically
will use the same functional parts in the new bridge, but we need to take it into account that we have
the first bridge, meaning page number one.
And if the value actually is less than one, then we need to make a decision.
So either we set new page equals to one meaning if we are trying to get to the proof bridge.
But pages already first one will always keep it as one.
So as you're clicking on the Preve bridge, you're not going to get any further, which kind of makes
sense because I mean, otherwise our functionality is going to break or in my case, what I'm going
to do.
I'm going to set new page equal to the numb pages, which is actually our last bridge.
And if you're someone iffy on this one, you'll see it in action.
I'm just showcasing right away alternative, but I'm not going to use this one.
And then when it comes to the next bridge, the idea is exactly the same.
However, in this case, I'm checking for the last page, so I'm checking if the new bridge is bigger
than I'm off pages, which is the last page.
And again, I need to make a decision either I just set new page equal to nine pages, which means that
user won't be able to get anywhere.
So once we are on the last page, that's it.
Or like my said, I'm going to go to a page number one.
Same deal.
We're passing the new page into the change page, so let's navigate to jobs container or sorry, the
page button container.
That's where I want it to be.
And then let's set up that logic right away.
We'll go with Let.
And learn new page that is equal to page minus one.
And before we set up the condition, let's right away call the change page as well sort change bridge
and New Bridge.
So hopefully we're clear on this one.
So this would be the most basic set up only thing we need to take into account that we have a first
page and last page, and if we'll just leave it the way it is, then at some point page will be zero,
which won't make any sense since I don't have here any buttons, first of all, but represent that and
also on a server, it's not going to make sense.
Correct.
So let's also right away and that commission what I'm going to say, if new page is less than my first
page, then we need to make a decision.
And in my case, I'm going to go to new page is equal to number of pages.
And that's why I'm setting this one up with Let let's save this.
And now let's do the same thing on the Senate.
I want to a next page, so you know, I'll have to copy and paste my apologies.
And this is the preview one.
Now we need to work on next door check arrhythmias.
Correct, though, so read me fine or here.
I just want the other way.
So now let's go with +1 for next page and in here or see if the new page is bigger than normal pages.
That's the last page run on.
Set it equal to you first.
So let's say this let's navigate to the browser and now what you'll notice not only I can change the
values over here using the buttons again.
Let me check it out.
So I have here page number five, but also as I'm clicking notice all the values changing.
And once I get the last one, I got two options.
Either we always keep it equal to the last page, which just means that as are going to be clicking,
you're not going to get any further or in my case, I'm going to go to page number one.
I'm not.
The same goes with Preve, where it may go to.
For me, if I go down now, I get the page number one, I need to make a decision and in my case, I'm
going to go to the last page.