OK, so now let's go ahead and create the egg transaction component like we've already constructed,
but let's add some functionality to it too.
Right now we have just hardcoded everything and we have not given any functionality to like adding the
transaction.
So let me just, first of all, import the required things.
So first of all, we import the U.S.
State and then we will import use context as well.
And in the next line, we will import our global context, but will be in AU.
On the other hand, global context from global context, auto imports for me.
OK, next.
What will do in the transaction is that we'll create a constant flow that will have the value of the
label, label or text.
Alright, so phones?
Know.
Sex and sex acts, you can call it liberal, and certainly, but I'm just calling it text.
Some places I call it a label, but works fine to state and initial value will be empty.
Shrink.
Next.
We'll have the amount also to consider in a moment, and then we have enough said.
Some of the spending is going to be used to.
Since it's a numerical value, so the initial amount would be zero.
All right.
So next what will do is that will create context in Utrecht using this.
Will be a transaction.
From Sack.
They will be in this context.
And inside, this will be global context.
All right.
There's something like this.
And next, we want to add some more functionality for moving on.
What will do with that?
What happens is that any form you submit or.
Is that like any form in a statement or an GSX, when you write and on the air, on the browser, when
you submit that form, so.
So generally, the natural tendency is that the page reloads and the site order.
So we want that to not happen.
So first of all, feel written on summit.
So whenever we create the click this button right or so we want to fight off a function is a which is
on some.
So this is what we are going to create a to function that will be on some level, so on some merit in
the.
We'll have event as an argument or E as an odd argument.
And so you don't put around.
If this is a really, really important thing, I was taught to live in one of the other projects and
this is really, really important.
It prevents the browser from reloading while submitting the form.
Next, what we will do is that we will create another constant for a new transaction.
So this will store the new transactions, new funds like Tron section and this will be like like this,
it will have an I.D. So it is really, really important.
So this will be a random I.D. It will be different for every other transaction.
Matt Tharp floor so that we only receive like integers, not the float floating point numbers.
That's why we are giving that top floor and inside this will have on metadata random mad dog random.
This dysfunction matador random function gives a random number to.
That will multiply it by two to three or five six, maybe.
Then.
So my column and next will give next.
Now among would be.
Plus, I'm out now what I am trying to say is that whenever we add I like new transactions, it should
add the value to the previous amount.
OK?
Whenever like we got a salary and we got another bonus to that bonus should be added to the salary.
But that is what we are doing here.
OK, so next what we will do is that.
We'll call this a transaction after this, so it will be a transaction to insert this will pass the
new transaction.
OK, so new transaction really paused here.
Now we want to add some functionality to this form, like on some methanol.
So first of all, in the form, the form will provide on some meat, on some meat.
We'll call the function on some.
Look this on somebody, the Dallas Cook function, and this on top of it is we have created.
OK, you can and you can name this function like A. and call the exact same name here.
That does seem like this.