#react.js #master-in-software-engineering
In this project you will learn how to create a React.js and how to apply all the important concepts.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
See deployment for notes on how to deploy the project on a live system.
First, you will need to clone or fork the repository into your Github
account:
$ git clone https://github.com/assembler-school/react-shopping-cart-components.git
The repository is made up of several branches that include the contents of each section.
The branches follow a naming strategy like the following:
main: includes the main contents and the instructionsassembler-solution: includes the solution
In order to fetch all the remote branches in the repository, you can use the following command:
$ git fetch --all$ git branch --allThen, you can create a local branch based on a remote branch with the following command:
$ git checkout -b <new_branch_name> <remote_branch_name>First, you will need to install the dependencies with: npm install.
Run the following command in your terminal after cloning the main repo:
$ npm installThe tests that validate your solution can be executed by runing the following command:
$ npm run test
In the assembler-solution branch you can see an implementation of these tools
if you'd like to use them.
In this pill we won't deploy the app.
React.js@testing-library/reacteslintprettierlint-stagedhusky
This is an overview of the main requirements of this project.
- You must follow all the instructions of the project step-by-step
- You should always try to solve them by yourself before asking for help
- You should always help your team members and fellow students 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 π―
/src/components/MainIn this step you will need to finish the code with the following requirements:
- return a
<main>html5 element that renders the{children}prop it receives - receive all the other
...propsand forward them to the<main>element - export the component from an
index.jsfile. you should export the default component if is the only one
The following test suite validates that everything is correct: <Main />.
/src/components/ButtonIn this step you will need to finish the code with the following requirements:
- return a
<button>html5 element instead of thediv - include all the previous props that the
divelement had - receive a
disabledprop that has a default value offalsethat is assigned to the<button>element - receive all the other
...propsand forward them to the<button>element
The following test suite validates that everything is correct: <Button />.
/src/App.jsIn this step you will need to finish the code with the following requirements:
- render the
<Home />component from thepagesfolder
This step doesn't have any tests.
/src/pages/HomeIn this step you will need to finish the code with the following requirements:
- uncomment all the code
- render the
<ProductsListing />component and pass the following props:products={...}handleDownVote={...}handleUpVote={...}handleSetFavorite={...}handleAddToCart={...}
The following test suite validates that everything is correct: <Home />.
/src/components/ItemCardIn this step you will need to finish the code with the following requirements:
- uncomment all the code
- destructure the following props in the component:
idimgtitleshortDescriptionisFavoriteupVotesdownVoteshandleDownVotehandleUpVotehandleSetFavoritehandleAddToCart
- add the styles in the
ItemCard.scssfile so that it matches visually the screenshot bellow - render the
imgprop inside animgelement - render the
FavoriteIconButtoncomponent and pass it the following props:handleSetFavorite={onSetFavorite}isFavorite=...
- render the
titleprop inside anh2element - render the
shortDescriptionprop inside apelement - render a
IconButtoncomponent and pass in the following props:aria-label="up vote product"handleClick={onUpVote}- children:
<ThumbDown />component - bellow it a
pelement with thetextContentof thedownVotes.currentValueprop
- render a
IconButtoncomponent and pass in the following props:aria-label="down vote product"handleClick={onDownVote}- children:
<ThumbUp />component - bellow it a
pelement with thetextContentof theupVotes.currentValueprop
- A
<Button>component that has the following prop:onClick={onAddToCart}- and a text of
Add to cart
- default export the component in the
index.jsfile
The following test suite validates that everything is correct: <ItemCard />.
/src/components/ProductsListingIn this step you will need to finish the code with the following requirements:
- uncomment all the code
- destructure the following props in the component:
productshandleDownVotehandleUpVotehandleSetFavoritehandleAddToCart...props
- render the
ItemCardcomponent using[].map()and pass in the following props:key={product.id}id={product.id}img={product.img}title={product.title}shortDescription={product.shortDescription}upVotes={product.votes.upVotes}handleUpVote={handleUpVote}downVotes={product.votes.downVotes}handleDownVote={handleDownVote}isFavorite={product.isFavorite}handleSetFavorite={handleSetFavorite}handleAddToCart={handleAddToCart}
- default export the component in the
index.jsfile
The following test suite validates that everything is correct:
<ProductsListing />.
To deliver this project you must follow the steps indicated in the document:
This project is licensed under the MIT License - see the LICENSE file for details
Thanks goes to these wonderful people (emoji key):
Dani Lucaci π» π π‘ π§ |
This project follows the all-contributors specification. Contributions of any kind welcome!

