Giter VIP home page Giter VIP logo

advanced-homework-2's Introduction

Setup

Fork, Clone, yarn install, yarn start

Do

  • Take the html out of the App component and put in separate components
    • Header - look for div with a className of "top-header"
    • Footer - look for div with a className of "footer"
    • ImageSlider - look for div with className of "image-slider"
    • ProductDetail - look for div with className of "grid_1_of_5"
      • Use PropTypes to require a prop "product"
      • Use product prop to populate the UI instead of hard coded
    • SubHeader - look for div with className of "sub-header"
    • TopNav - look for div with className of "top-nav"
  • Make sure to import and use all these components back in App
  • Create a variable in index.js called currentCategory and set it to "tires"
  • Create a function in index.js called changeCategory thats takes a parameter category. It will assign category to currentCategory and call render()
  • Send the changeCategory function to App and then to the TopNav component by way of props
  • Send the currentCategory to App by way of props
  • App should use the currentCategory value to filter the array of products by category and then map over them to create ProductDetail components
  • Modify TopNav
    • Remove existing href and replace with "#"
    • Register onClick for the links, make sure to use arrow function. Make sure to preventDefault.
    • In the arrow function call props.changeCategory("tires"). Send in the category that is appropriate for the link

advanced-homework-2's People

Contributors

jw56578 avatar mymonstermaggie 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.