Enhanced UX: Added Cart Badge, Clear Cart Feature, and 404 Routing#3
Open
codeCraft-Ritik wants to merge 1 commit intoGovind783:mainfrom
Open
Enhanced UX: Added Cart Badge, Clear Cart Feature, and 404 Routing#3codeCraft-Ritik wants to merge 1 commit intoGovind783:mainfrom
codeCraft-Ritik wants to merge 1 commit intoGovind783:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Dynamic Cart Badge: Updated src/components/NavBar.js to display a real-time item count on the shopping bag icon using Redux state.
Clear Cart Functionality: * Added a clearCart action in src/redux-state/CartState.js to reset the cart.
Implemented a "Clear Cart" button in src/components/CartHold.js to allow users to empty their cart with one click.
404 Page Handling: Added a catch-all route in src/App.js to display a "Page Not Found" message for invalid URLs, improving site navigation.
Code Refactoring: Optimized the NavBar component by replacing multiple boolean states with a single activeDropdown state for better scalability and cleaner code.