From 235701552da94104352ce9c44bfa0d650bbef52e Mon Sep 17 00:00:00 2001 From: Christopher Evans Date: Tue, 8 Oct 2024 15:17:56 +0200 Subject: [PATCH] Update README.md --- week3/project/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/week3/project/README.md b/week3/project/README.md index 23605b60b1..a288a18fcc 100644 --- a/week3/project/README.md +++ b/week3/project/README.md @@ -20,6 +20,8 @@ What you need to have done at the end of the week: - For the images in the product list as well as the product details page there needs to be a heart that if clicked will update the favourites array in the context. The heart should show the right svg file depending if it is favourited or not. - Your app should have a favourites page to list all of the products the user has favourited. You will need to perform multiple fetches as you only have the `id` of the favourites. > Storing the whole object would make this easier of course and in this example would probably be a better solution, but we want to challenge you a bit by adding a multiple fetch scenario. + + > Your product cards on your home page and on your favourites screen should display the same data (image, price, name, and favourites button). Instead of writing out the JSX twice, create a `ProductCard` component and render it on both pages. - Add a navigation bar at the top that handles routing between `/` and `/favourites`. The `/favourites` route should go the favourites page. - If you did the same things as us then in the Products and ProductDetails pages you will have quite a lot of duplicate logic concerning the `loading` and `error` states of all those requests. Fix that by creating a `useFetch` custom hook. > Your custom hook will have a couple of challenges. The URL for the products changes and you will have to perform that fetch whenever the user clicks a category so you will need to give the user of your hook the option to do that.