From 4fb8969f6994d8414f388f583d8e270d4e4a67e9 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Fri, 23 Mar 2018 11:11:09 -0400 Subject: ya --- frontend/components/Cart.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'frontend/components/Cart.js') 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 => ( {context => ( -- cgit v1.3