-
Notifications
You must be signed in to change notification settings - Fork 14
elad-abutbul #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
elad-abutbul #2
Conversation
Tamir198
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left you some comments, the comments apply for everywhere in the code, didnt want to repeat mysef
src/components/showCard/ShowCard.tsx
Outdated
|
|
||
| // TODO 4: Create ticketsStatusText (string): | ||
| const ticketsStatusText = | ||
| ticketsLeft === 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Save 0 and 30 inside const variables, this is because its confusing to see 30 inside the code while MAX_TICKET_NUMBERS for example is much more readable.
Also, using 2 ? : expressions and nesting them can be a bit hard to read (Try to add 1 more and see if its readable to you)
src/components/showCard/ShowCard.tsx
Outdated
| : "Tickets available"; | ||
|
|
||
| const interestedText = isInterested | ||
| ? "This show is in your interested list 🎟️" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The texts should some from constants folder
| <main> | ||
| <div className="shows-grid"> | ||
| {/* TODO - shows.map((show)=>{ return <ShowCard id={show.id} .../> })*/} | ||
| {shows.map((show) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the name of the prop is the same as what you are sending you can spread the show object something like this :
{shows.map(show => (
<ShowCard key={show.id} {...show} />
))}Notice that I added the key prop, why is that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i read we use key so react can uniquely identify each component in a list and preserve the correct state between renders and the key is not passed as a prop
| /* TODO 1: Accept props with ShowCardProps type here */ | ||
| ) { | ||
| export default function ShowCard({ | ||
| artist, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work destructing those props
No description provided.