Coder Social home page Coder Social logo

react-burger-stacker's Introduction

Burger Stacker

You will be writing an app that simulates the stacking of a burger. You are provided an array of ingredients and you need to make an app the displays all the ingredients on the left side and has an area on the right where the ingredients can be stacked to make a burger.

Here is a rough wireframe of the general layout:


User Stories

  • As a user, I want to see all available burger ingredients listed on the left side.
  • I want the ability to add any ingredient onto the burger stack using a button.
  • I want to see each ingredient I select added to the top of the burger stack on the right side.
  • I want the ability to clear the burger stack so I can start again.
  • I want to be able to add as many ingredients of any type as I want (ingredients don't go away.)

How To Get Started

  1. Fork & clone this repository
  2. Cd into this directory and run npx create-react-app . to make this directory into a react app.
  3. Open in your code editor.
  4. Clear out the generated code from the App component.
  5. Draw a component diagram.
  6. Write the static versions of your components.
  7. Import and nest components so you have your start screen built for the app. (See the Starter Data section below for a list of ingredients.)
  8. Decide what the state should be.
  9. Decide where the state should live.
  10. Write the handler callbacks that you pass into children to update state.

Sample Idea for Component Hierarchy:

App
|--IngredientList
|  |--Ingredient(s)
|
|--BurgerPane
|  |--BurgerStack
|  |  |--Ingredient(s)
|  |
|  |--ClearBurger

Notes:

The order of items in the stack array will affect the order in which they appear on the page. Make sure you are adding ingredients to the stack in the correct way to make each ingredient stack on the previous one.

Starter Data:

Here are some ingredients to get you started. Feel free to change them or add more. (This would be the value you set for ingredients when you initialize state):

[
  {name: 'Kaiser Bun', color: 'saddlebrown'},
  {name: 'Sesame Bun', color: 'sandybrown'},
  {name: 'Gluten Free Bun', color: 'peru'},
  {name: 'Lettuce Wrap', color: 'olivedrab'},
  {name: 'Beef Patty', color: '#3F250B'},
  {name: 'Soy Patty', color: '#3F250B'},
  {name: 'Black Bean Patty', color: '#3F250B'},
  {name: 'Chicken Patty', color: 'burlywood'},
  {name: 'Lettuce', color: 'lawngreen'},
  {name: 'Tomato', color: 'tomato'},
  {name: 'Bacon', color: 'maroon'},
  {name: 'Onion', color: 'lightyellow'}
]

BONUSES

  • Each ingredient has an associated color. Use this to give each ingredient a nice background color reminiscent of what it looks like in real life.
  • Add a form component (simply text input and button) to the ingredient side that lets a user add a new ingredient to the master list of ingredients in state.
  • Add the ability to "undo" the last ingredient added (only the last one) by clicking a button that will remove that ingredient. Only that top ingredient should have the button for this showing up. When that ingredient is removed, the next one down should then get the button that allows it to be removed. HINT: You probably need to add this button to the top Ingredient when you render it in the BurgerStack component.

Licensing

  1. All content is licensed under a CC-BY-NC-SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

react-burger-stacker's People

Contributors

azocher avatar shullmb avatar taylordarneille avatar

Watchers

 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.