Coder Social home page Coder Social logo

lab-react-ironcontacts's Introduction

logo_ironhack_blue 7

IronContacts

Introduction

After Ironhack, you have decided to work in the movie industry, and you've found a job where you need to manage the contacts of a famous producer.

We are going to create a contact management app with React for this producer.

You can find the starter code in the starter code folder of this GitHub repo.

Submission

  • Upon completion, run the following commands

    git add .
    git commit -m "done"
    git push origin master
    
  • Create Pull Request so your TAs can check up your work.

Installation

$ cd starter-code
$ npm install
$ npm start

Instructions

Iteration 1 | Display 5 Contacts

Let's take a look at the starter code.

Inside src folder, we can find contacts.json, a JSON file with the producer's contacts. Import this file and create an array of the 5 first contacts to use as your initial state.

Display that array of 5 contacts in a <table> and display the picture, name, and popularity of each contact.

To import contacts.json in App.js, you can simply use:

import contacts from './contacts.json'

At the end of this iteration, your application should look like this:

Screenshot

Iteration 2 | Add New Random Contacts

In your application, create a Add Random Contact button so that every time you click on this button, it adds a new random actor.

First, randomly select a contact from the larger contacts array. Then add that contact to the array that lives in your state (that's the previously created array of 5). Don't forget to setState() to cause React to re-render the app.

At the end of this iteration, your website will probably look like this:

Screenshot

Iteration 3 | Sort Contacts By Name And Popularity

The producer asked you to add two new buttons to help them sort their contacts. When you click on one of the buttons, it should sort the table by name (alphabetically) and when you click the other, it should sort by popularity (highest first).

Don't forget to setState() after you sort!

This is what you may have at the end of this iteration:

Screenshot

Iteration 4 | Remove Contacts

The producer also would like to remove some of their contacts. Implement a Delete button on each row of your <table> that will let the user remove the contact they clicked.

When they click, you should get the index of the array of that actor and use it to remove the contact from the array. Don't forget to setState() after you remove the contact!

At the end of this iteration, your app may look like this (after playing a little bit with the Delete button):

Screenshot

Iteration 5 | Bonus | Styling

Unfortunately, this contact list isn't production ready. This is the movie business! It has to sparkle! Add some beautiful CSS to make the app "pop".

Happy coding! ❤️

lab-react-ironcontacts's People

Contributors

sandrabosk avatar samacriano avatar mc100s avatar papuarza avatar mjarraya 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.