GithubHelp home page GithubHelp logo

lab-vue-c-ironcontacts's Introduction

logo_ironhack_blue 7

LAB | Vue.js IronContacts (Composition API)

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.

Your task is to create a contact management app for the producer using Vue.js.

Setup

  • Fork this repo

  • Clone this repo

  • Open the LAB and start:

    $ cd lab-vue-c-ironcontacts
    $ npm install
    $ npm run dev

Submission

  • Upon completion, run the following commands:

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

Getting Started

Clean the App.js component so that it has the following structure:

// src/App.vue
<template>
</template>

<script setup>
</script>

<style>
</style>

Instructions

Iteration 1 | Display 5 Contacts

Let's take a look at the starter code.

Inside the src folder we have a contacts.json file containing the producer's contacts. Import the contacts.json file to App.vue. Once done, create a ref variable named contacts that stores an array containing the first 5 contacts.

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

For now, let's render the content in App.vue. This being said, don't proceed to create a dedicated component for the contact list. For now, let's just render everything in one component.

Let's proceed.

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

import contacts from "./contacts.json";

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

Check image inside - Iteration 1

Screenshot - Iteration 1

Iteration 2 | Conditionally Display Awards Info

The producer would like to see the information about the awards that contact has won.

Update the list and add two more columns "Won an Oscar" and "Won an Emmy", at the end of the table. Then, depending on the value wonOscar and wonEmmy of each contact, conditionally render a trophy icon ๐Ÿ† or no content.

Once done, your application should look like this:

Check image inside - Iteration 2

Screenshot - Iteration 2

Iteration 3 | Add New Random Contacts

In your application, create a Add Random Contact button. Every time you click on this button, it should add a new random contact to the contacts. You should get random contacts from the remaining contacts that are still not showing.

First, randomly select a contact from the array of remaining contacts. Then add that contact to the array that lives in your data ref (that's the previously created array of 5 contacts).

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

Check image inside - Iteration 3

Screenshot - Iteration 3

Iteration 4 | 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).

Once you have sorted the array, remember to update the ref variable holding the contacts.

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

Check image inside - Iteration 4

Screenshot - Iteration 4

Iteration 5 | 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 id of that actor and use it to remove the contact from the array. Remember to update the ref variable holding the contacts after you remove the contact!

When done, your app should look like this (after playing a little bit with the Delete button):

Check image inside - Iteration 5

Screenshot - Iteration 5

Iteration 6 | Bonus | Styling

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


Happy coding! ๐Ÿ’™

lab-vue-c-ironcontacts's People

Contributors

sandrabosk avatar

Watchers

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