Giter Site home page Giter Site logo

lab-thinking-in-react's Introduction

logo_ironhack_blue 7

Thinking in React

image

Introduction

One of the many great parts of React is how it makes you think about apps as you build them. In this exercise, we’ll walk you through the thought process of building a searchable product data table using React.

We have a data.json file with some data about products of a random store. Our JSON API looks like this:

{"category": "Sporting Goods",  "price": "$49.99",    "stocked": true,    "name": "Football"},
{"category": "Sporting Goods",  "price": "$9.99",     "stocked": true,    "name": "Baseball"},
{"category": "Sporting Goods",  "price": "$29.99",    "stocked": false,   "name": "Basketball"},
{"category": "Electronics",     "price": "$99.99",    "stocked": true,    "name": "iPod Touch"},
{"category": "Electronics",     "price": "$399.99",   "stocked": false,   "name": "iPhone X"},
{"category": "Electronics",     "price": "$199.99",   "stocked": true,    "name": "iPad Mini"},
{"category": "Sporting Goods",  "price": "$199.99",   "stocked": true,    "name": "Tennis Balls"},
{"category": "Electronics",     "price": "$199.99",   "stocked": true,    "name": "Huawei P10"}

Requirements

  • Fork this repo
  • Clone this repo

Submission

  • Upon completion, run the following commands

    git add .
    git commit -m "done"
    git push origin master
    
  • Navigate to your repo and create a Pull Request

Deliverables

Iteration 1 - Break The UI Into A Component Hierarchy

The first thing you’ll want to do is to draw boxes around every component (and subcomponent) in the mock and give them all names. In this 1st iteration, we will help you, then is on your own:

image

You’ll see here that we have five components in our simple app. We’ve italicized the data each component represents.

  • FilterableProductTable (orange): contains the entirety of the example
  • SearchBar (blue): receives all user input
  • ProductTable (green): displays and filters the data collection based on user input
  • ProductCategoryRow (turquoise): displays a heading for each category
  • ProductRow (red): displays a row for each product

Now that we’ve identified the components in our mock let’s arrange them into a hierarchy. This is easy. Components that appear within another component in the mock should appear as a child in the hierarchy:

  • FilterableProductTable
    • SearchBar
    • ProductTable
      • ProductCategoryRow
      • ProductRow

Iteration 2 - Build A Static Version in React

You should build a static version of our app, listing all the elements and displaying both, the search bar and the checkbox you see on the image. Notice that products that are out of stock have been displayed in red-

image

Iteration 3 - Filter the Products

Ok, we are ready to give some life to our app. Go ahead and add the filter functionality. Every time somebody types a letter the list should update, listing only values that match what the user is writing.

image

Iteration 4 - Checkbox

Another feature of our ToDo List is a checkbox to filter the products when they are out of stock. Go ahead and add this functionality.

image

Iteration 5 - Styling your App

Finally, let give some style to our ToDo List. Feel free to style it how you want. Here is an idea 😉

image

lab-thinking-in-react's People

Contributors

enstef avatar papuarza avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.