-
Notifications
You must be signed in to change notification settings - Fork 14
to do list implemented #7
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?
Conversation
todo completed
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
| export default function ShowCard( | ||
| /* TODO 1: Accept props with ShowCardProps type here */ | ||
| ) { | ||
| export default function ShowCard(props: ShowCardProps) { |
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.
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); |
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.
Do you really need the generic in here?
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.
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) { |
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 all of your numbers inside constant variables
|
|
||
| let ticketsStatusText = ""; | ||
| if (props.ticketsLeft === 0) { | ||
| ticketsStatusText = "SOLD OUT"; |
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.
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} /> |
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.
You can also :
{shows.map((show) => (
<ShowCard key={show.id} {...show} />
))}
No description provided.