3.15 duty 1 time to practice react and component basic
All right after all this we’ll keep on creating other files still in component
This time we will create the record only expenses.Against the others
where there is item or date in front of you creates expenses.js and another file or the same you put
expenses but this time you marked . css
And this time what we’re gonna do now you’re gonna take all the code here.
Which is in app.js and you will put it right here.
In expenditure.js we will transfer it to this page then you will bring the items expense on the page
expense.js and bring you also expense. You add it will always be the same use it is just in the transfer
on the other page don’t worry then we’ll go spending. That is what we have just created
and you put expenses .
Simply then we can name a map of component because it is a card aspect specific
and it’s not a term we’re gonna make card.js
don’t forget to put the capital C very important usually means some kind of appearance
of counter with rounded corners.
Of shadows
that’s why I chose the map like us here
all of this is going to be card-shaped
so we’re going to start writing in do we’ll put a return and we’re in
this div we’ll be able to put what doesn’t turn meaning it does not return the name card and as always
below do not forget to put export.
with a capital C
then we’ll create another file
which will be card point css
And before we fill anything we’re gonna go return to the map.js
and we’ll import card.
css now we can go on the map. CSS we’re going to need two things, that is who
we’re gonna need to spend.css the box shadow
and border radius with these two too being able.
Put our me we will go into item.js expense And here at class place Name we go
change with card the same for below.
and between these two we can import card to be recognized.
We’ll go back to map.js and normally you should remind you of that we did it in the last price
it’s the props.children
So children It’s a book name agree
we do not put children on this card
I send a place name accessory
and actually for now it won’t do anything
but I don’t send children’s accessories
just add a const classcard more props.className
as you can see here the class and highlight
so it doesn’t make that mistake
what we’re gonna do this is just gonna delete the card and inside we’ll add the word class
and you can see it’s gone
and that there our code is good we go now go back into JS spending and now we’re going
import card from here exactly like this Normally it should go on.
Here as before we can remove the div for the addition.
Replace by card and of course it is also necessary change it downstairs.
I’ll see you in the next class.