Awesome job.
Our initial functionality works.
We can get the user.
Now, we haven't covered followers in repose yet.
Don't worry.
We're going to get there.
But before we do that, I would want to implement some kind of state of loading, because eventually,
once we start reaching the followers and reports and all that is just gonna take a little bit longer
for the user.
I mean, it was there and then.
But once you start getting all of the info, I mean, it just takes a little bit of time.
So even if the users really come back fast, I mean, it would benefit us if we were to have some kind
of state of loading.
Correct.
Now, it was my preference to set up the lowering below the search bar.
So when I'm loading the user, I just have the lowering component displayed below here.
I'm still displaying the search as well as the number.
Now, that's up to you.
If you'd want to have a state of loading were essentially you hide everything like we have when we load
the application, when we're collecting we the off zero and all that, that's up to you.
You can definitely do that.
So in my case, I have two states of loading.
One where I'm dealing with authentication.
And then the second one where I'm looking for the user.
So when I search for to get our user, you'll see that the loading is displayed out here.
So everything here is shown.
OK.
That is my preference.
Of course, if you want to change around, you can definitely do that.
But I just hope that it's still important to show the search bar.
I don't know why.
I just thought that that would make a little bit more sense.
So what I'm trying to say is that we're gonna go back to our application and for the time being, we're
just gonna change state of loading to true.
Of course, eventually we'll do that programmatically from our search user.
What forten timing is just going to be set the true by default.
And once we do that.
And now I'd want to go back to a dashboard.
So that's my main component.
And I would want to get from that dashboard.
I want to get that ease loading.
Now, first, of course, I would need to pass it in show loading.
And be let's do is loading.
So is loading on line.
The function is set, is loading.
Let's scroll down right after.
Get every user.
We're gonna say is loading.
Hey, beautiful.
And then in the dashboard I would want to pull it out and we can do that while of course we simply go
with concert.
Then I'm looking for ease loading.
Then that is coming from react.
And use context, of course.
And then we're looking for the get up context.
And then if that is the case, if I'm loading, then I would want to display my dashboard a little bit
differently.
So I'll have two returns.
I'll have one when I'm not loading on.
The other one if, of course, I'm loading the user to repose on the followers.
So any armor say if is loading, if it is true, then I would want to return main.
So I'm still gonna go with mine.
However, in the main, I'm just gonna to turn a nav bar here.
I'm just going to turn a search on.
I'm also going to return my loading component.
So how is that going to look like?
Well, it's simply going to be a image with a source.
And by the way, the loading, Jeff, is right here.
So if you take a look at the images and preload or you'll find the drift.
So I'll set my images source to loading that image, because that is, of course, the name that I gave.
And land, let's add a class name and then we're gonna go with loading.
And then I M.G..
And of course, we can do alternative.
And we're gonna go with a loading.
Let's close out our image.
And since it is true.
Now, of course, you can clearly see that.
Correct.
So let me navigate back and you'll see that this is my loading.
So that's what I would want to show while I'm getting the user info again.
If it is your preference to remove the search, you can definitely do that as well.
It wasn't mine.
That's really your preference.
So let me go back.
I'm gonna go back to search because I like to keep my search.
Now, one thing that I would that I'd want to add is our want to hide the button, no inner search.
So I'm going to go back to search and we're going to take a look at is loading.
So we're getting that from the get up context.
And let's keep on scrolling.
Let's keep on scrolling.
Notice here where I have requests are bigger than zero that I'm showing the button.
Correct.
So now we would probably want to change this around.
But where I would want to say, if the user is bigger than zero and I'm not loading, then I would one
display.
Correct.
So I'm going to go with.
If requests are bigger than zero and then is loading is not true.
So I just need to sit here like this and then I'm gonna say that I'm displaying the button.
And once I add one more and operator, of course everything works when I'm loading.
The user cannot just keep on typing and getting more users.
So that's our functionality.
Now, let's head back to a context and then, of course, we'll set it back to falls for the time being.
We're going to say here, false like so.
So loading is not going to be by default.
And of course, I would want to implement it when I start fetching for the user.
Correct.
So remember set loading.
We're going to uncommented right now.
So we have set loading to true.
Then we're getting all the data and everything.
And now, of course, the last thing that I would want out or here is to hide loading once I'm done
with my request as well as check requests, because I would want to right away display how many requests
I have.
So I'm going to go check requests.
I'm going to invoke it.
Anonymous.
Set.
Is loading.
And that is, of course, gonna be false.
So now when I'm searching for user and of course it says, oh, here set is loading is not true.
Let's say.
And the reason why it's doing that is because, of course, in here it's not set loading.
It is set is loading my bad.
Now by default, it is not loading.
That's why we cannot see the spinner.
But if I navigate back and then if we start searching for the users, we're gonna go with the worst
BOSBACH.
And then of course, we saw a little bit of loading and now we saw the repos and all that.
So we successfully implemented the loading spinner as well.
So now every time we'll search for the user, we'll have our spinner.
And only when we get our beta back then we will hide these loading spinner.