Skip to content

Conversation

@Elad-Abutbul
Copy link

No description provided.

Copy link
Member

@Tamir198 Tamir198 left a 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


// TODO 4: Create ticketsStatusText (string):
const ticketsStatusText =
ticketsLeft === 0
Copy link
Member

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)

: "Tickets available";

const interestedText = isInterested
? "This show is in your interested list 🎟️"
Copy link
Member

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) => {
Copy link
Member

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?

Copy link
Author

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,
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants