diff --git a/src/3-refactorable/good/Cart.js b/src/3-refactorable/good/Cart.js index d1c535a..4c35be8 100644 --- a/src/3-refactorable/good/Cart.js +++ b/src/3-refactorable/good/Cart.js @@ -3,10 +3,6 @@ import React, { Component } from 'react'; export default class Cart extends Component { constructor(props) { super(); - this.state = { - localCurrency: props.localCurrency, - inventory: props.inventory, - }; this.CurrencyConverter = props.currencyConverter; } @@ -15,7 +11,7 @@ export default class Cart extends Component { return (

Cart

- {window.cart.length === 0 + {this.state.cart.length === 0 ?

Nothing in the cart

: @@ -28,7 +24,7 @@ export default class Cart extends Component { Price - {window.cart.map((itemId, idx) => ( + {this.state.cart.map((itemId, idx) => (
{this.state.inventory[itemId].product}