Giter Club home page Giter Club logo

ada-pets-react's Introduction

Ada Pet Rescue

At a Glance

  • Individual, stage 1 project
  • To be completed in class, Tuesday December 11th. No pull request is required.

Learning Goals

This project is designed to exercise the following skills:

  • Reading and understanding a substantial amount of existing React code
  • Lifting React state from a child component to a parent component
  • Event handling in React across several levels of nested components

Introduction

Ada Lovelace is starting a pet rescue service advertising pets in need of rescue online. This App should load the list of pets automatically and present a list of pets with thumbnail images. The user should be able to select a pet and see details, add new pets and remove a pet from the App once adopted. On this site users can see pets up for adoption and view them in greater detail, remove pets from the app, add new pets and filter the list. You can see a running example here.

Setup

  1. Fork and clone this repository
  2. run npm install to install dependencies
  3. run npm start to start the dev server

Requirements

Each of the waves includes a number of questions. Though you should write your own code, feel free to collaborate with other students as you work on these questions.

Wave 0: Reading

We have already implemented some parts of this application:

  • Code to load JSON pet data in App.js
  • 3 functional stateless components: PetList, PetCard and PetDetails
  • CSS for all components. You shouldn't need to write any CSS for this project.

Before you start writing code, read through what's already here and make sure you understand it by answering the following questions:

  • How do the components relate to each other? Draw a diagram.
  • How does data get from App.js to PetCard.js?

Wave 1: Viewing Details

When the user clicks the details button the app should present the user with additional details on the selected pet. Read through the provided propTypes attribute of the given components, what information does that provide?

Questions:

  • How will you track which, if any Pet is the currently selected Pet? Which component will keep the state?
  • Will you need to switch a functional component to a classical component?
  • What events should you listen for?
  • Draw a diagram of the flow of rendering and callbacks in your app so far, similar to the one we drew in class.

Wave 2: Removing Pets

When the user clicks the remove button on a PetCard, that animal should be removed from the application, including if that animal is the currently selected pet.

Wave 3: Adding Pets

Add a component to the application called NewPetForm to add a new Pet. This should be a controlled form. New pets should not be added unless they have a name, an image link and a species.

Questions: (same as for wave 2)

  • How will a new pet information arrive in a PetCard component?
  • Will the new component be a functional stateless component or a class component.
  • Draw a diagram of the flow of rendering and callbacks in your app so far, similar to the one we drew in class.

Optional: Wave 4: Filtering the list

Add a component called SearchBar. This component should consist of an input and when the user types in the input field, the list of pets should be filtered to only include pets whose about, species or name fields match the text in the input. You can use JavaScript's match function to assist.

Questions

  • Should this component be a functional stateless component or a class component?
  • Which component should track the filtered list of pets?

Further Optional Enhancements

Don't even read this list until you've completed the core requirements.

  • Notice that each pet in the application can have multiple images, add functionality to switch between images.
  • Add functionality to change the pet order.

ada-pets-react's People

Contributors

cheezitman avatar elle-johnnie avatar

Watchers

James Cloos avatar  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.