Make sure you created a new week3 branch from the main branch of your forked repo. Then copy over the ecommerce folder you made last week into the week3/project folder.
Copy over the assets folder to your ecommerce/src folder. We will use these svg files for our favourites functionality.
We are going to implement some cool new features this week now that we have all of the React building blocks at our disposal. By the end of the assignment your application should work similar to this:
There is a live version here
What you need to have done at the end of the week:
id of all of the favourites of the user. You should not store the whole object!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.
/ and /favourites. The /favourites route should go the favourites page.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. Extra challenge: We purposefully do not say Favourites page here as that would make the custom hook even more difficult to build. If you are up for the challenge, add functionality to your hook for multiple fetches!