#react.js
#master-in-software-engineering
In this project you will learn how to create a React.js Wish list.
This is a wishlist feature for an e-commerce app built with React that allows users to save products they are interested in purchasing for future reference. The wishlist feature is built using useState
, useEffect
, useContext
, input events
or any other hooks you feel ready to use in order to create a seamless user experience.
This is a wishlist feature for an e-commerce app built with React that allows users to save products they are interested in purchasing for future reference. The wishlist feature is built using useState, useEffect, useContext and input events to create a seamless user experience.
This is an overview of the main requirements of this project.
- You should always try to solve them by yourself before asking for help
- You should always help your team members and fellow squad members of the master so that you can all learn together and become better software developers and team members
- You must finish all the steps that are marked as
Required
- You must use semantic HTML5 elements for all the markup of the application
- Once you are done, you can move on to the optional ones that are marked as
Extra 💯
For this step you have to think of the layout for the app and implement some sketches using platforms such as Figma or a similar app.
- For the styles you can use any library or native languages such as
CSS
,SCSS
orStyled Components
. - The layout must be responsive so that it works in all device sizes
In this step you must implement the logic to render all the wishlist items of the app. This means that all the wishlist items are rendered without taking into account if they are completed or not.
- A wishlist must be created and its state passed as props or context to the required page components
- All the methods that modify the state must also be passed as props or context
- If there are no wished items created you must render a message telling the user that they can create their first wish to get started
- You can also render an illustration that indicates users how they can create a wish to get started. (You can use illustrations on your own or use one from the internet, this is a great resource: undraw.co ).
Users should be able to add products to their wishlist by clicking a "Add to Wishlist" button on a product page. The product information should be stored in the app's state using useState.
- If the user presses enter without entering a value in the wish form, an error message should be rendered.
- Users must be able to press the
enter
key on their keyboard to create the wish (if you implement it using semantic html5 this comes for free)
Users should be able to view their wishlist by clicking a "View Wishlist" button on the app's main navigation. The wishlist should be displayed as a separate component that shows all the products the user has added to their wishlist. This feature could use useContext to access the app's state.
- By default the list should be empty.
- The list must be implemented using
ul
andli
elements. - To test the wish creation requirement you will need to:
- the
li
list element should have acheckbox
value set tochecked
or not depending on if the wish was marked as completed.
- the
Render the total number of wishes in the app footer.
- At the above image, we are providing a general guidence towards what you could include here and how to separate the items.
Users should be able to edit the quantity of a product in their wishlist. This can be done using input events and updating the app's state with useState
.
- Clicking the wish name should open a form that allows users to edit the wish
name.
- This can be implemented either in line or by filling out the new wish form with the details of the wish that was clicked
- We recommend that you implement a solution that allows users to edit the wish in line. This means that clicking the wish name replaces the wish with a form that has a value of the wish's name
- Then, by clicking on the done button or by pressing enter, the wish is edited and saved
- Users should be able to delete wishes by clicking the
X
button that is rendered when users hover over the wish name. The removed wish should be removed from the app's state using useState. - Users must be able to mark a wish as completed when they press the
Done
button that is rendered when the user hovers over the wish name
In this step you will create a page for each wish type.
In order to allow users to navigate to a page you will need to complete the footer of the app that you can see in the screenshot above.
You will have to render the following in the footer:
- The total count of all the
active
wishes - A link to the home page that renders
all
the wishes, both active and completed - A link to the active wishes page that renders the
active
wishes - A link to the completed wishes page that renders the
completed
wishes
- Route:
/
- Page Component:
Home
In this page you will render all the wishes, both completed or not.
- Route:
/completed
- Page Component:
Completed
In this page you will render all the completed wishes.
You will need to think of a way to store or filter the wishes that are completed.
A possible solution is to use [].filter
or to store the wishes in a different
this.state
property.
Feel free to think of a solution for this requirement.
- Route:
/active
- Page Component:
Active
In this page you will render all the active wishes, that is, all the wishes that are not completed.
You will need to think of a way to store or filter the wishes that are active.
A possible solution is to use [].filter
or to store the wishes in a different
this.state
property.
Feel free to think of a solution for this requirement.
The app should persist the user's wishlist data between sessions. This feature can be implemented using localStorage
, sessionStorage
or cookies
so that users can refresh the app and their previous wishes are not lost. You can also add them directly from the database.
You must store the wishes in a single local storage entry named:
"wish-list"
.
The wishes should be stored using the following shape (you can add other properties but these are required):
id
: the id of the wishtext
: the text content of the wishdone
: boolean that indicates wether the wish is completed or notisEditing
: boolean that indicates wether the wish is currently being edited
[
{
id: "9c34e805-7bfc-401a-b386-468c25315e46",
text: "wish 01",
done: false,
isEditing: false,
},
{
id: "d733a37e-cc4e-4cde-916f-935b3e915bb3",
text: "wish 02",
done: false,
isEditing: false,
},
];
You should use interfaces in favor of having everything typed correctly. To increase productivity in this area, you can use the following page or the resulting vscode extension.
Users should be able to add notes to a product in their wishlist. This feature can be implemented using input events and updating the app's state with useState.
Users should be able to sort and filter their wishlist by product name, price, or other criteria. This feature can be implemented using useEffect to update the app's state based on user input.
Users must be able to clear all the wishes that are completed. You can implement a button in the app footer that allows users to clear the completed wishes.
Users should be able to share their wishlist with friends or family via email or social media. This feature can be implemented using a third-party API or library.
The wishlist feature is an important component of any e-commerce app that allows users to save products for future purchase. By using useState, useEffect, useContext and input events, we can create a wishlist that provides a seamless user experience. The must-have features ensure that the basic functionality of the wishlist is in place, while the should-have features provide additional functionality that can enhance the user's experience.
To deliver this project you must send us the link to your repository or branch within your classroom card.
This project is licensed under the MIT License - see the LICENSE file for details
This project follows the all-contributors specification. Contributions of any kind welcome!