Conversation
src/components/showCard/ShowCard.tsx
Outdated
| // true → "This show is in your interested list 🎟️" | ||
| let ticketsStatusText; | ||
|
|
||
| if (ticketsLeft <= 0) { |
There was a problem hiding this comment.
Save you numbers into variables so it will not be so confusing (magic numbers) and the hard coded strings inside constant file (This comment apply to all the numbers and hardcoded texts)
src/components/showCard/ShowCard.tsx
Outdated
|
|
||
| let interestString; | ||
| if(isInterested) | ||
| interestString = "this show is in your interested list 🎟️" |
There was a problem hiding this comment.
One more possible way of doing it is :
interestString = isInterested
? "this show is in your interested list 🎟️"
: "You haven't added this show yet";| <div className="show-image-wrapper"> | ||
| {/* TODO 6: Replace placeholder with real <img> from props */} | ||
| {/* <img src={image} alt={artist} className="show-image" /> */} | ||
| <img src={image} alt={artist} className="show-image" /> |
There was a problem hiding this comment.
Great work on the alt attribute
src/App.tsx
Outdated
| <div className="shows-grid"> | ||
| {/* TODO - shows.map((show)=>{ return <ShowCard id={show.id} .../> })*/} | ||
| {shows.map((show)=> { | ||
| return <ShowCard id={show.id} artist={show.artist} day={show.day} |
There was a problem hiding this comment.
You could also :
{shows.map(show => (
<ShowCard key={show.id} {...show} />
))}This is because the props that ShowCard is expecting to get got the same names as the show object.
Also did you notice that I added a key prop? why is this ? try to understand
There was a problem hiding this comment.
becase "key" is a saved word and you cant access it?
There was a problem hiding this comment.
Ye its a saved word but why i added it?
No description provided.