PROD [Live] : https://react-usereducer-cart-v2-prod.netlify.app/
- List of some of the items added to the cart, Navbar with the title useReducer , cart amount i.e. total number of items added by default, and a
CLEAR CARTbutton to clear all items in the cart which on click showsYOUR BAG is currently empty. - Each cartItem has the
image,title,price,amount, along with a few buttons i.e.removeto remove the item from the cart, 🔼 to increase , 🔽 to decrease the amount of that particular item and when the item amount gets less than 1, it is automatically removed from the cart. - For every change in cartItem, the total price and cart amount gets adjusted.
Loadingspinner will be shown while fetching data, once the data is available cart will be shown.- Data is handled by
API, and styles are handled byindex.css - To run the project locally, clone the repo,
npm installto install the dependencies, andnpm run devto start up the development server on default port 5173.
HTML, CSS, JavaScript, ECMAScript, React ~ ContextAPI - Hooks ~ useEffect, useReducer, useContext
https://www.course-api.com/react-useReducer-cart-project
Netlify
Note: I have developed this project ~ [15] as part of React 18 Tutorial and Projects Course (2023) taught by John Smilga.