Skip to content

Conversation

@Rutwika1409
Copy link

…updates

Pull Request Template

Summary

This PR adds full wishlist, cart, and checkout functionality to the MsCafe app.
It also fixes a UI bug where the quantity toggle (- / +) was not appearing after an item was added to the cart from the shop.
Layout spacing, responsiveness, and cart/wishlist interaction have been refined to closely match the shop page UI.
Includes Tailwind and PostCSS config improvements and a SPA-friendly routing fix in nginx.

Fixes # (issue)

Type of Change

Please mark [X] for applicable items:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Other (please describe):

Testing

Tested locally by:

  • Adding and removing items in both wishlist and cart
  • Verifying that the quantity toggle appears after adding to cart
  • Navigating across pages to confirm data persistence
  • Confirming layout responsiveness on desktop.
  • Verifying /checkout route loads correctly

Screenshots/Videos

Screenshot 2025-07-31 at 12 16 57 AM Screenshot 2025-07-31 at 12 17 16 AM Screenshot 2025-07-31 at 12 17 27 AM Screenshot 2025-07-31 at 12 17 54 AM Screenshot 2025-07-31 at 12 18 25 AM

Checklist

Please mark [X] for completed items:

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@vercel
Copy link

vercel bot commented Jul 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
coffee-shop ❌ Failed (Inspect) Aug 5, 2025 5:37pm

@github-actions
Copy link

Thank you for your contribution! 🎉

PR Checklist

  • Tests added/updated
  • Documentation updated
  • Changes follow coding standards
  • Commit messages are clear

Next Steps

  1. We will review your PR soon
  2. Address any requested changes
  3. Once approved, your PR will be merged

Need help? Check our Contributing Guide

Happy coding! 💻

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements comprehensive shopping functionality for the MsCafe app, including wishlist management, enhanced cart operations, and checkout workflow. The changes provide a complete e-commerce experience with persistent data storage and improved user interface components.

  • Adds wishlist functionality with ability to add/remove items and move between cart and wishlist
  • Enhances cart with improved UI, quantity controls, and localStorage persistence
  • Implements floating cart/wishlist buttons and enhanced product interaction components

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/componets/FloatingCart.js New floating cart/wishlist widget with mini-cart preview functionality
src/componets/AddToCartButton.js Enhanced add-to-cart component with quantity controls and buy-now functionality
src/Store/cartSlice.js Updated Redux slice with wishlist actions and localStorage persistence
src/Pages/wishlist.js New wishlist page with product management and cart integration
src/Pages/cart.js Enhanced cart page with improved UI and wishlist integration
src/Pages/Shop.js Updated shop page to integrate new components and wishlist functionality
src/App.js Added wishlist route and duplicate component rendering
Comments suppressed due to low confidence (1)

src/Store/cartSlice.js:54

  • Missing closing brace for the if statement. The else block is not properly closed, which will cause a syntax error.
        } else {

src/App.js Outdated
<Chatbot />


<ToastContainer position="top-right" autoClose={2000} />
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are duplicate component renderings in this file. The ToastContainer, ContentContainer with Routes, Reviews, Chatbot, and Footer components are rendered twice, which will cause rendering issues and potential conflicts.

Copilot uses AI. Check for mistakes.
dispatch(addToCart(product));
toast.success(`${product.name} added to cart! Redirecting to checkout...`, { autoClose: 2000 });
// Navigate to cart page after a short delay
setTimeout(() => {
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using window.location.href for navigation in a React SPA breaks the single-page application pattern. Consider using navigate('/cart') from react-router-dom instead of setTimeout with window.location.href.

Copilot uses AI. Check for mistakes.
dispatch(removeFromWishlist(item.id));
toast.success(`${item.name} added to cart! Redirecting to checkout...`, { autoClose: 2000 });
setTimeout(() => {
window.location.href = '/cart';
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using window.location.href for navigation in a React SPA breaks the single-page application pattern. Use navigate('/cart') instead to maintain SPA behavior and avoid full page reloads.

Suggested change
window.location.href = '/cart';
navigate('/cart');

Copilot uses AI. Check for mistakes.
margin: 0 auto;
background-color: #fffbeb;
padding-top: 1.5rem;
padding-top: 1.5rem;
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The padding-top property is declared twice with the same value (1.5rem). Remove the duplicate declaration.

Suggested change
padding-top: 1.5rem;

Copilot uses AI. Check for mistakes.
@Mujtabaa07
Copy link
Owner

@Rutwika1409 fix this i'll merge it
Failed to compile.
[eslint]
src/App.js
Syntax error: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (241:6) (241:6)
Error: Command "npm run build" exited with 1
Exiting build container

git push origin feature/cart-wishlist
@vercel
Copy link

vercel bot commented Aug 4, 2025

@Rutwika1409 is attempting to deploy a commit to the mujtabaa07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Aug 5, 2025

Deployment failed with the following error:

Environment Variable "REACT_APP_GOOGLE_CLIENT_ID" references Secret "react_app_google_client_id", which does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants