Skip to content

Commit

Permalink
Fix more Good Refactorable cart
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmcdermott committed Mar 8, 2017
1 parent 368b9cf commit f915263
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/3-refactorable/good/Cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -15,7 +11,7 @@ export default class Cart extends Component {
return (
<div>
<h2>Cart</h2>
{window.cart.length === 0
{this.state.cart.length === 0
? <p>Nothing in the cart</p>
: <table style={{ width: '100%' }}>
<tbody>
Expand All @@ -28,7 +24,7 @@ export default class Cart extends Component {
Price
</th>
</tr>
{window.cart.map((itemId, idx) => (
{this.state.cart.map((itemId, idx) => (
<tr key={idx}>
<td>
{this.state.inventory[itemId].product}
Expand Down

0 comments on commit f915263

Please sign in to comment.