diff options
Diffstat (limited to 'frontend/components')
| -rw-r--r-- | frontend/components/Cart.js | 4 | ||||
| -rw-r--r-- | frontend/components/UIContext.js | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/frontend/components/Cart.js b/frontend/components/Cart.js index 8752c54..26a11d4 100644 --- a/frontend/components/Cart.js +++ b/frontend/components/Cart.js @@ -80,7 +80,7 @@ const Cart = props => { const totalPrice = me.cart.reduce((tally, cartItem) => tally + cartItem.quantity * cartItem.item.price, 0); return ( - <UIContext> + <UIContext.Consumer> {context => ( <CartStyles open={context.state.isCartOpen}> <header> @@ -103,7 +103,7 @@ const Cart = props => { </footer> </CartStyles> )} - </UIContext> + </UIContext.Consumer> ); }; diff --git a/frontend/components/UIContext.js b/frontend/components/UIContext.js index 0e851c0..103475e 100644 --- a/frontend/components/UIContext.js +++ b/frontend/components/UIContext.js @@ -3,6 +3,8 @@ import React from 'react'; const UIContext = React.createContext(); class UIProvider extends React.Component { + displayName: 'OMGME'; + state = { isCartOpen: false, }; |
