Giter Site home page Giter Site logo

pwj-reactjs-basics's Introduction

ReactJS 101 Todos

TODO(Together): Create your first ReactJS App

Use the tutorial HERE

TODO(Together): Start the Amazon Cart App

TODO: Create the Header using JSX

HTML Structure

.App
    .App-header
        h1 "Amazon Cart"

TODO(Together): Style the Header in ReactJS

TODO(Together): Convert the Header to a ReactJS Component

TODO: Pass the title argument into the Header component

HINTS:

  • Title should be Amazon Cart
  • Use props

TODO(Together): Create HTML/Style for Cart Items and Cart Total

TODO: Convert Cart Items and Cart Total into components

HINTS:

  • Name the components CartItems and CartTotal

TODO: Create individual CartItem component structure

HTML Structure:

.CartItem
    div.CartItem-image
        img
    div.CartItem-info
        div.info-title
            h2
        div.info-stock
        div.item-actions
            div.item-quantity
                select
            div.item-delete
    div.CartItem-price

TODO(Together): Create Style for individual CartItem component

TODO(Together): Import data from data.js and set it in the State

TODO: Pass the data into CartItems components as props

TODO: Loop through cart items list and display them using JSX

HINTS:

  • Use the .map function
  • Output the original Cart Item with fake data

TODO: Convert CartItem component to now use props and pass them in

HINTS:

  • Use item as a prop
  • Replace fake data with data from cart items list
  • For the image src use process.env.PUBLIC_URL

TODO(Together): Create HTML and Style for CartTotal Component

TODO: Calculate total price from cart items list

HINTS:

  • Create a getTotalPrice() function
  • Output it using JSX

TODO(Homework): Correctly calculate cart total

The way I do it is wrong, and I want you to fix it ;)

TODO(Together): Install your first external React Module to format the total price number

TODO(Together): Add the ability to change item quantity in the cart

TODO: Add the ability to delete an item in the cart

HINTS:

  • Create a deleteItem() function
  • Pass the function from CartItems to CartItem component
  • Pass the index of the item to know which item to delete
  • Use the filter() function in es6 to filter out item based on index
  • Update the items using setCartItems() function

TODO(Together): Cleanup

TODO(Together): Publish the APP LIVE!!!!

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.