And once we have the state of ours, let's finally start working in the actual job one and before you
wonder, well, why didn't we set them up globally?
I mean, why we couldn't just do it like we did with register where we had the values in the actual
page and the local state values.
And we were good to go.
You say, because eventually we'll have all the jobs and the way I set up the functionality we'll edit
in the ad job.
So actually, this is a hodgepodge where instead of adding the job, we will edit.
And effectively, this is where we will use that.
Switch, remember, we have is editing, so set is editing will grab the idea and then we'll provide
the values in the input.
And that where we can combine the both.
When I have one page where I do the adding the job and editing job functionality, and therefore it's
easier if those powers are sitting in the global because that way I can always access them and toggle
them and hopefully you get where I'm going with this.
Again, just answer the question because I know that I'll get some questions and Kiran.
And like I said, I started working in the actual job page.
So we're half warm and therefore we'll look for form role and we'll also have to set up Form Row Select.
We're also on a display alert if the user doesn't provide all the values, as well as when the job has
been successfully added.
We're also, of course, want to get used context.
And this is the case where I'll use the same wrapper like in the profile one, because again decided
that it's easier for me to combine both styles.
There's no need to set up two separate ones, and here we'll grab branch of values from the state,
starting with shoulder to display alert.
And I'm position company.
And of course, you're going to read the rest unless there's more functions still coming in.
There's going to be handles, submit as well as handle job input, but I'm not going to talk about them
right now.
I simply want to showcase that as far as our return.
Have the wrapper and yes, there's going to be a form class form.
Remember, we have is running.
That's the global one.
And then by default, it's going to be false.
So have our job.
But once it's true, we'll have a job.
And I'm fully confident that at this point, we already understand what's happening, meaning we have
used these operators already.
So even though technically we're not using is editing right now, hopefully it is clear that since it
is false, will essentially display our job.
And then once we toggle that switch, then it's going to be the added job, Charlotte.
Just like in the previous components, if it's true, we display it.
If not, then of course we don't display it.
And then we have few inputs.
We have one for position, one for company, one for location.
And then when it comes to job and job status, we'll set this one up in the next video because I want
to do it step by step where again, we'll create everything locally here, and then I'll showcase how
we can move it into a separate component.
And then at the very, very end, we'll have a button container.
So in this case, we'll have two buttons submit and clear.
So make sure it is a button container and insider.
We're going to go with button, then a few classes here for styling type.
I will invoke the handle submit or here online for all of these ones who have this handle, job input
and both of them are going to be over here.
So handle job input is going to look for around and we want to get the name as well as the value.
So notice here, when I'm setting up that input, I pass in what is the name of the property and this
goes by this position and also the value, the line.
Every time I'll type something, I'll get both of them back.
I'll get the name as well as the value.
Now, why do I need that?
Well, because eventually there's going to be functionality that sets up everything state.
So as we're typing, not only we are just accessing those numbers, but will also change those values
in the state.
And as far as the submit for time being, let's just prevent a default much check for empty hours.
In this case, again, we're checking for the state fires.
The ones that we just imported above, and if one of them is missing, then we go display, alert and
return.
If not, then we go would create job.
That's all we want to do right now.