Skip to content

hw3#3

Open
chanjessica wants to merge 2 commits into
frontend-application-development-uw20:masterfrom
chanjessica:master
Open

hw3#3
chanjessica wants to merge 2 commits into
frontend-application-development-uw20:masterfrom
chanjessica:master

Conversation

@chanjessica
Copy link
Copy Markdown

Week 3 HW Submission

Please fill out the information below in order to complete your assignment. Feel free to update this comment later if necessary.

  • Comfort rating on this assignment (1-5): 1|2|3|4|5
  • Completion rating on this assignment: complete|incomplete

Comment thread ecommerce-ui/src/cart.js

)
}
<span className="total">Total = ${checkout.reduce((total, rental) => parseFloat(total) + parseFloat(rental.price), 0)}</span>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice reduce fuction!

};
static propTypes = {
rData: PropTypes.arrayOf(
PropTypes.shape({
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great use of shapes here!

return (e) => {
e.preventDefault();
// alert(id + ' ' + rental + ' is removed from your cart');
const newCheckout = this.state.checkout.filter(rental => rental.id !== id);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice!

<main>
{
this.props.rData.map((x, i) =>
<dl key={i}>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Dang, breaking out the <dl> tag, huh?

<div>
<main>
{
this.props.rData.map((x, i) =>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit use a more descriptive variable name than x

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