Skip to content
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

Patrick/add cart page #11

Merged
merged 8 commits into from
Mar 30, 2020
Merged

Patrick/add cart page #11

merged 8 commits into from
Mar 30, 2020

Conversation

patrick-fs
Copy link
Member

@patrick-fs patrick-fs commented Mar 27, 2020

This PR adds the view/edit cart page. Please see comment thread for a callout/question for review.

return (
<ListGroup>
{ products.map((product, i) => (
<ListGroup.Item key={i}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this list could get resorted (based on the name sort), the key={i} can lead to weirdness:
https://medium.com/@robinpokorny/index-as-a-key-is-an-anti-pattern-e0349aece318

Might be time to create an ID for each product, or, if the title is unique, then use that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've used product.id - thanks for the link.

src/actions/cart.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@timjchin timjchin left a comment

Choose a reason for hiding this comment

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

LGTM!

@patrick-fs
Copy link
Member Author

LGTM!

Hey @van-fs would you please review as well.

Copy link
Member

@van-fs van-fs left a comment

Choose a reason for hiding this comment

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

LGTM

@patrick-fs patrick-fs merged commit 4475321 into master Mar 30, 2020
@patrick-fs patrick-fs deleted the patrick/add_cart_page branch March 30, 2020 11:45
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.

3 participants