diff options
Diffstat (limited to 'frontend/components/Cart.js')
| -rw-r--r-- | frontend/components/Cart.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/frontend/components/Cart.js b/frontend/components/Cart.js index fee757e..0a77754 100644 --- a/frontend/components/Cart.js +++ b/frontend/components/Cart.js @@ -6,6 +6,7 @@ import formatMoney from '../lib/formatMoney'; import { UIContext } from './UIContext'; import CartItem from './CartItem'; import { CURRENT_USER_QUERY } from '../queries/index'; +import calcTotalPrice from '../lib/calcTotalPrice'; const CartStyles = styled.div` padding: 20px; @@ -72,10 +73,6 @@ const CloseButton = styled.button` right: 0; `; -function calcTotalPrice(cart) { - return cart.reduce((tally, cartItem) => tally + cartItem.quantity * cartItem.item.price, 0); -} - const Cart = props => ( <UIContext.Consumer> {context => ( |
