Giter Site home page Giter Site logo

022023-phase-2-react-state-practice-planets's Introduction

React State Practice - Planets

This practice focuses a lot on conditional rendering however you'll also have to use a lot of state and understand information flow.

Getting Started

Fork and clone the repository and then run npm install followed by npm start.

Deliverable One

Map through all of the planets and display them as PlanetCards in the PlanetContainer.

Hint: We're passing them from App for a reason that'll be important later...

Deliverable Two

Create a toggle between light mode and dark mode! When we click the button that says 'Toggle Light Mode', a piece of state changes which conditionally gives the className App light-mode or App dark-mode for the main div in App.

Hint: You'll want your state in App...

Hint: It'll be easiest if you create a piece of state that's either true or false and use a ternary.

Deliverable Three

When a planet card is clicked, change it so that instead of the picture, it displays the planet's information. This can be toggled so if it gets clicked again, it shows the planet picture again.

To make your life easy, everything you'll need for the planet's facts is located in the PlanetFacts component.

Deliverable Four

If a planet is not classified as a planet (probably a dwarf planet or an asteroid) then give the planetary image a className of not-planet. For example:

<img className="not-planet" />

If a planet is in fact a planet, leave its className empty with an empty string or null.

Hint: You won't need state for this one...

BONUS: Deliverable Five

When someone types into the search bar in PlanetSearch they can see only the planets whose names match.

Hint: The planets array lives in App... where should the state for your search term go?

022023-phase-2-react-state-practice-planets's People

Contributors

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