coryhouse / coryhouse/react-restaurant-scriptpro
Create CartContext + useCart using useState
Open
enhancement
phase-5-cart
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Goal
Add a `CartContext` provider exposing `items`, `addItem`, `removeItem`, `updateQuantity`, `clear`, `totalItems`, `totalPrice` via `useState`. Persist items with `useLocalStorage`.
## Acceptance criteria
- [ ] `CartProvider` wraps the app inside the root route
- [ ] `useCart` hook returns the cart API
- [ ] Cart state persists across reloads via `useLocalStorage`
- [ ] All cart actions are pure functions of prior state
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.