Skip to content

feat: implement product wishlist feature with ProductCard and Wishlist page - #43

Open
omsrajput977 wants to merge 2 commits into
Vikram-sardiwal:mainfrom
omsrajput977:feature/product-wishlist
Open

omsrajput977 wants to merge 2 commits into
Vikram-sardiwal:mainfrom
omsrajput977:feature/product-wishlist

Conversation

@omsrajput977

Copy link
Copy Markdown

Description

Implemented a complete Wishlist feature allowing users to add/remove products from their wishlist, view saved items on a dedicated Wishlist page, and persist wishlist state in localStorage. Included interactive heart toggle buttons on product cards, an empty wishlist state with a call-to-action button, and a live item count badge in the navigation bar.

Related Issue

Closes #18

Type of Change

Please select all applicable options:

  • Bug fix
  • New feature
  • Documentation update
  • UI/Styling improvement
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • Created WishlistContext, WishlistProvider, and useWishlist hook to manage wishlist state with automatic localStorage persistence.
  • Implemented ProductCard component with an interactive heart toggle button, category tag, pricing, and removal actions.
  • Created a dedicated Wishlist page (/wishlist) that displays saved products, supports one-click item removal, "Clear Wishlist", and an empty state with a "Browse Products" button.
  • Created a Products catalog page (/products) with sample developer gear data for exploring and testing the wishlist feature.
  • Updated Navbar with navigation links to Products and Wishlist, including a live badge counter for saved items.
  • Added responsive styling, smooth heart animations, and full dark mode (html[data-theme="dark"]) support in src/App.css.

Testing

  • Ran npm run lint successfully
  • Tested the changes locally
  • Verified the affected functionality
  • Checked for console errors or warnings
  • Checked responsive design where applicable

Documentation

  • Updated the README or documentation if necessary
  • No documentation changes are required

Screenshots / Videos

Checklist

Before submitting this pull request, please confirm:

  • My code follows the project's coding standards.
  • I have tested my changes locally.
  • I have run npm run lint and resolved any issues.
  • I have not introduced unnecessary dependencies.
  • I have updated relevant documentation where necessary.
  • I have reviewed my own changes before requesting a review.
  • I have created a separate branch for this change.
  • I have linked the related issue.
  • Existing functionality still works.

Additional Notes

The wishlist state automatically persists across browser refreshes using localStorage. All components include PropTypes validation for type safety.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Wishlist Functionality

1 participant