Skip to content

CustomerPage

Vin.ce edited this page Dec 8, 2024 · 3 revisions

Overview:

The CustomerPage component serves as the main interface for customers to interact with the Panda Express system. It includes navigation between different categories, shopping cart management, and recent orders viewing.

Key Features:

  • Category Selection: Allows users to choose from categories such as bowls, plates, drinks, and sides.
  • Cart Management: Users can view, add, and remove items from the shopping cart.
  • Recent Orders: Displays recent orders based on user interactions.
  • Dynamic Views: The page renders different views like the SelectionPage, DrinksPage, and CustomerCart depending on the selected category and cart state.

Usage:

<CustomerPage />

This component manages the state for the selected category, shopping cart, and recent orders. It includes several helper functions like handleGridClick, handleCartClick, and addComboToCart to handle user interactions and updates the UI accordingly. It calls on the MenuBar, EntreesPage, DrinksPage, CustomerCart, and PreviousOrders component depending on the user selection.

Functions:

  • handleGridClick: Sets the selected category when a category grid item is clicked.
  • handleCartClick: Displays the shopping cart.
  • addComboToCart: Adds a new combo to the cart, formatted with step-by-step item data.
  • showRecentOrders: Navigates to the recent orders view.

Clone this wiki locally