Skip to content

Conversation

@dashaaaa21
Copy link

No description provided.

@sycons sycons self-requested a review January 18, 2026 16:04
@sycons sycons self-assigned this Jan 18, 2026
Copy link

@sycons sycons left a comment

Choose a reason for hiding this comment

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

Following were implemented:

  • Copy over the assets folder to your ecommerce/src folder ✅
  • A context that stores the id of all of the favourites of the user (not the whole object) ✅
  • Heart clicked on product list page and product details page updates the favourites array in the context ✅
  • Favourites page listing the products user has favourited ✅
  • Navigation bar at the top that handles routing between / and /favourites
  • Create a useFetch custom hook to reuse logis for loading and error states ✅
  • Deploy app somewhere (like netlify) and add link to PR ✅

Requested improvements:

  • Fix linting error in FavouritesContext.jsx. I've added comment on the file. You can also run npm run lint to view the linting errors.

Great job on the styling and adding UI components like banner, FAQ and contact info ⭐
It's nice to see you trying out features beyond the assignment and increasing your skill level.

Also great job on using a context for a shopping cart and implementing it ⭐

@@ -0,0 +1,48 @@
import { createContext, useState, useEffect } from "react";

export const FavouritesContext = createContext();
Copy link

Choose a reason for hiding this comment

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

Please fix this linting error "Fast refresh only works when a file only exports components. Move your React context(s) to a separate file."

More info: https://dev.to/md_belayethossain_56e787/fast-refresh-only-works-when-a-file-only-exports-components-why-does-this-problem-occur-and-how-1b4

Copy link

@sycons sycons left a comment

Choose a reason for hiding this comment

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

Some optional changes you can implement to make your code more structured and maintainable.


function AppContent() {
const location = useLocation();
const showHero = location.pathname === "/";
Copy link

Choose a reason for hiding this comment

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

OPTIONAL: A better way to do this is to move showing the HeroSection to the HomePage. This will eliminate this line 14 and line 19. This also makes the code more maintainable.

return { data, loading, error, refetch };
}

export function useMultipleFetch(fetchFunctions) {
Copy link

Choose a reason for hiding this comment

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

OPTIONAL: This hook can be moved to its own file.

</div>
</section>

<section className="bg-gray-50 py-16">
Copy link

Choose a reason for hiding this comment

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

OPTIONAL: This can be moved into a component called Faq

</div>
</section>

<section className="relative bg-gradient-to-br from-sky-500 via-sky-400 to-sky-500 text-white py-20 overflow-hidden">
Copy link

Choose a reason for hiding this comment

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

OPTIONAL: This can be moved into a component called FollowUs.

Separating into components will make the HomePage smaller and those components can be used in other pages when needed.

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