Skip to content

ferdous1996h/Restaurant-product-list-with-cart

Repository files navigation

Restaurant Product list with cart solution

This is a solution to the Product list with cart challenge on Frontend Mentor.

Table of contents

Overview

The challenge

Users should be able to:

  • Add items to the cart and remove them
  • Increase/decrease the number of items in the cart
  • See an order confirmation modal when they click "Confirm Order"
  • Reset their selections when they click "Start New Order"
  • View the optimal layout for the interface depending on their device's screen size
  • See hover and focus states for all interactive elements on the page

Screenshot

screenShoot

Links

My process

Built with

  • HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • React - JS library
  • useContext hook
  • createPortal method from react

What I learned

  • how to use useContext in react children and share data between the childrens
  • how to use useRef to render the useEffect after first render
  • use Object method to update and delete data from state
  • use callback function to return data to parent
  • dynamic object property existance check using 'object[variable]===undefined' method
  • Math.max(prev-1,0) method to prevent accidental negative cart value

Releases

No releases published

Packages

 
 
 

Contributors