Giter Club home page Giter Club logo

whats-new's Introduction

What's New?

This application was built with create-react-app.

Set Up

Clone down this repo.

Because you don't want to be pushing your updates to this boilerplate repository, we're going to have to do a few things to get set up with your own repository.

  1. On GitHub, create a new, empty repository and name it something like 'whats-new'.
  2. Update the current remote (called "origin") so that it points at the URL of the repository you just created on GitHub. Read how to do this here.
  3. Once you've updated the remote, you should run npm install, commit, and then push your initial commit to your personal repository. You will need to use the -u flag when you push (like this: git push -u origin master).
  4. Run npm start to start up your React server. (You will see errors!)

Expectations / Rules

Build a React App that displays different categories of current news.

what's new screenshot

We want to see good commit habits - atomic commits that log small, focused changesets.

Iteration 0

Get set up (per the instructions above)!

We've provided a boilerplate for you to work with. Look through the file structure to get a sense of the app.

Notice that we have multiple stylesheets - one for each component. You are welcome to style this application however you'd like as long as it keeps the core functionality. We got you started with a little styling, but feel free to get creative. (Remember, though - most of your energy should be spent on learning React, not styling.)

Iteration 1

Create a NewsContainer component, which will act as a container that renders each of our news articles. For now, the news articles being displayed will be "Local News". Figure out how to pass information from App.js to NewsContainer.js!

Then create a NewsArticle component. Each NewsArticle card will display: the image, the headline, the description, and the url (see the screenshot above for an idea).

In your NewsContainer component, create NewsArticle cards that have the information each needs to display properly.

Test Your App with snapshot tests.

Iteration 2

Take a look at the data directory and inspect the other news data that is included. There is an entertainment.js, health.js, science.js, and technology.js file. Import the data and put it in App's state. Create a Menu component that has navigation to display the different news articles. When selecting a navigation link, it should display the relevant news articles in the NewsContainer component. How can you reuse components?

Add/Update any snapshot tests necessary. Also add tests for any new methods you have created or changes in state

Iteration 3 (extension - do not attempt until iterations 0 - 2 are completed)

Add in the functionality so that a user can search through the news articles. After a user has typed a search query, a user should either be able to press Enter or Search to filter out the correct news articles. The search functionality should only filter through the selected news articles.

Add/Update any tests necessary. Remember to include tests for any new methods you have created or changes in state

Iteration 4 (extension - do not attempt until iterations 0 - 3 are completed)

Instead of importing the news data from the data directory, use the Fetch API to get the data. Read this article on where you should fetch your data in React.

Here is what the endpoint looks like to get the news data.

Purpose URL Verb Request Body Sample Success Response
Get all news data https://whats-new-api.herokuapp.com/api/v1/news GET none {"entertainment": [{}, {}, ...], "health": [{}, {}, ...], ...}

Note: This will likely break some of your previous tests. No worries, we will discuss testing async functionality in a future lesson.

whats-new's People

Contributors

linda-le1 avatar robbiejaeger 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.