diff --git a/src/components/CardEntry.js b/src/components/CardEntry.js new file mode 100644 index 0000000..3fc18c0 --- /dev/null +++ b/src/components/CardEntry.js @@ -0,0 +1,25 @@ +import React from "react"; +import { Link } from "react-router-dom"; + +const CardEntry = props => { + const { idMeal, strMeal, strMealThumb } = props.item; + return ( + +
  • +
    +
    +
    +
    + {strMeal} +
    +
    +

    {strMeal}

    +
    +
    +
    +
    +
  • + + ); +}; +export default CardEntry; diff --git a/src/components/CategoryEntry.js b/src/components/CategoryEntry.js index 8003c97..128e14c 100644 --- a/src/components/CategoryEntry.js +++ b/src/components/CategoryEntry.js @@ -11,6 +11,7 @@ const CategoryEntry = props => { const { url } = useRouteMatch(); return ( + //
  • diff --git a/src/components/SearchResult.js b/src/components/SearchResult.js index dab6b5b..2b98eb7 100644 --- a/src/components/SearchResult.js +++ b/src/components/SearchResult.js @@ -1,34 +1,9 @@ import React from "react"; -import { Link } from "react-router-dom"; +import CardEntry from "./CardEntry"; const SearchResult = props => { const { meal } = props; - const { idMeal, strMeal, strMealThumb } = meal; - - return ( - -
  • -
    -
    -
    -
    - {strMeal} - {/* {strMeal} */} -
    -
    -

    {strMeal}

    -
    - {/*
    -
    -

    {strCategoryDescription}

    -
    -
    */} -
    -
    -
    -
  • - - ); + return ; }; export default SearchResult; diff --git a/src/pages/Category.js b/src/pages/Category.js index 0283750..8f31f3f 100644 --- a/src/pages/Category.js +++ b/src/pages/Category.js @@ -1,5 +1,6 @@ import React, { useEffect, useState } from "react"; import { useParams, Link, useRouteMatch } from "react-router-dom"; +import CardEntry from "../components/CardEntry"; const CategoryPage = props => { const [meals, setMeals] = useState({ meals: [] }); @@ -15,28 +16,21 @@ const CategoryPage = props => { }, []); const { url } = useRouteMatch(); - // const { - // strCategory, - // strCategoryThumb, - // strCategoryDescription - // } = props.category; return (

    Chef's {strCategory} Recipes

    - {/* {strCategory} -

    {strCategoryDescription}

    */}
      {meals.meals.map((meal, i) => (
    • + {/* */}
      {meal.strMeal} - {/* {meal.strMeal} */}

      {meal.strMeal}