Skip to content

Conversation

@brauni18
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

export default function ShowCard(
/* TODO 1: Accept props with ShowCardProps type here */
) {
export default function ShowCard(props: ShowCardProps) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Destruct your props

export default function ShowCard(props: ShowCardProps) {
// TODO 2: Create state called isInterested of type boolean (default false)
// const [isInterested, setIsInterested] = ...
const [isInterested, setIsInterested] = useState<boolean>(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need the generic in here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it so, in what scenarios would you recommend explicitly defining the generic vs. letting inference handle it?

// >30 → "Tickets available"

let ticketsStatusText = "";
if (props.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 all of your numbers inside constant variables


let ticketsStatusText = "";
if (props.ticketsLeft === 0) {
ticketsStatusText = "SOLD OUT";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALL of the strings should come from constant file

<div className="shows-grid">
{/* TODO - shows.map((show)=>{ return <ShowCard id={show.id} .../> })*/}
{shows.map((show) =>{ return (
<ShowCard id={show.id} artist={show.artist} stage={show.stage} day={show.day} hour={show.hour} ticketsLeft={show.ticketsLeft} image={show.image} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also :

{shows.map((show) => (
  <ShowCard key={show.id} {...show} />
))}

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