SHARE
TWEET

Untitled

a guest Jul 16th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top