Not bad, not bad ones, we've got our global product context in place, and we can clearly see that
we can access the data.
I guess we can start by destruction.
And as far as the sidebar will look for two things.
I would want to look for close sidebar function, since I would want to run it when I click on a button
as well as the links.
And eventually we'll also have to pass it into the card buttons.
Because remember, my idea was following the moment we click on something inside of the sidebar, I
would want to hide it anyway because there's no point of navigating to a different page if I still show
the sidebar, since it will take up the whole screen.
So in here, I'll remove these two.
I don't need them.
And then remember from the state, what was the proper name is sidebar open number one.
And the second one is close and the sidebar function now I'll have to change this one first.
So say is sidebar open.
So now I'm checking for this global property, meaning property that is coming from my product context.
And if everything is correct, we should still hide the sidebar.
And if we want to double check that, let's just go to the product context.
And so this is true just to make sure that we're getting the correct values and everything works.
Once we save, we should see the sidebar.
So for some reason I don't.
So maybe I just need to refresh.
And there is once a refresh.
Of course I can see the sidebar.
So now let me go back to false.
And as a side note, as far as this refreshing, it looks like I'm going to have to do a little fix
in my setup and I'm going to cover that in NextRadio.
And this video, unfortunately, will have to see me refreshing each and every time we'll make some
changes and I'll talk about it in the next days.
Why is that happening and what is going to be a quick fix?
So let's navigate back to the sidebar.
So we have right now global property is somewhere open, which, of course, just checks whether it
is true.
And let me just make sure it is false.
Yep, it is.
And then once I click on a button, of course, I would want to run those sidebar.
So so let's set up here on Click.
This is going to be equal to close sidebar function.
Now, I would want to do the same set up for my links, so let me copy and paste the same thing.
So in here I have the link and I would want to set up my own click show.
And I would also want to do it on checkout and eventually also I would want to do it where I have my
card button.
So let me navigate to my card buttons.
Notice here again, I'm using the used products context, so I'm grabbing it from there and I just want
the closed cart functionality.
So for now, I think it's going to be easier if I just copy and paste.
So, so in the card buttons and I don't need the value that is irrelevant to me.
However, I have close sidebar and what I would want is to add on both of them.
I believe it's on both of them.
Once I click on, I would want to close it or you're not going.
Honestly, when we are working with Log-in going to do it by default.
So it doesn't really matter.
We can go here where we have the link and we'll copy and paste the same thing.
So we're going to go on click.
Let me close the sidebar here, the text at our sidebar, and we're going to go with close and then
sidebar.
And the last thing that is missing in our puzzle is, of course, the number which has the button that
controls whether we can see this.
So let's now get there, find where is my file.
So I have filters and for some reason I'm struggling to find my number again.
I have the same thing.
Use products, context, so const and in this case I'm looking for open sidebar function that is equal
to use product context.
Of course I invoke it.
And then where have the button, the toggle button now, of course, I would want this on carnality,
so on click and then open sidebar and I'm going to save them, navigate to the bigger screen.
And in this case, I'll have to refresh just to make sure that everything works.
I'm going to go to the small screen, notice now I have my button.
Once I click, I can see the sidebar because now, of course, we change the global property.
I have all my links.
I can close it like so am I can open it up again.
And then once I click on one of the links again, I close the sidebar.
That was the whole point because again, otherwise I wouldn't be able to see the page and the same works.
If we go to the card again, logging will eventually do that anyway by default.
Since long story short, it's just going to do it by default and that's why we'll just check out.
There it is.
We navigate to the court page and of course, we close the sidebar.
Beautiful.
We have sidebar in place.
We have no and now we can proceed to the next step in our application.