Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import React, { useContext } from 'react'
  2. import Recipe from './Recipe'
  3. import RecipeSearch from './RecipeSearch'
  4. import { RecipeContext } from '../context/index'
  5. export default function RecipeList() {
  6. const appContext = useContext(RecipeContext)
  7. const { showHomeButton, recipes, handleReturnHome } = appContext
  8. return (
  9. <>
  10. <RecipeSearch></RecipeSearch>
  11. <div className="container my-5 home-button">
  12. {showHomeButton && <button type="button"
  13. className="btn btn-warning"
  14. onClick={() => handleReturnHome()}>
  15. Go Back Home
  16.  </button>}
  17. <div className=" d-flex d-flex justify-content-center mb-3">
  18. <h1 className="text-slaned ">Recipe List</h1>
  19. </div>
  20. <div className="row recipe-list">
  21. {recipes.map(recipe => {
  22. return <Recipe
  23. key={recipe.recipe_id} recipe={recipe} />
  24. })}
  25. </div>
  26. </div>
  27. </>
  28. )
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement