This commit is contained in:
Ruidy Nemausat 2020-01-31 20:23:43 +01:00
parent 4c8ffd52f3
commit bce9407986
5 changed files with 12 additions and 9 deletions

View file

@ -59,6 +59,8 @@ Free meal planner for cooks short on ideas! (like me …)
- Send a daily suggestion to newsletter
- History
- Language selection
- Nutritive value
- Add personal notes
## Supports
@ -98,3 +100,4 @@ Free meal planner for cooks short on ideas! (like me …)
- code cleanup (props and refactoring)
- Back to top button
- Take a look at some components [here](http://react-materialize.github.io/react-materialize/?path=/story/css-grid--default)
- Breadcrumb

View file

@ -142,10 +142,7 @@ export const App = () => {
</Route>
<Route exact path="/categories">
<CategoryListPage
categories={categories}
getCategories={getCategories}
/>
<CategoryListPage items={categories} getCategories={getCategories} />
</Route>
<Route path="/categories/:strCategory/">

View file

@ -1,12 +1,12 @@
import React from "react";
import { Link, useRouteMatch } from "react-router-dom";
const CategoryEntry = props => {
const CategoryEntry = ({ category }) => {
const {
strCategory,
strCategoryThumb
// strCategoryDescription
} = props.category;
} = category;
const { url } = useRouteMatch();

View file

@ -45,6 +45,9 @@ export const MealPresentation = props => {
</li>
<li>
<b>Origin:</b> {mealArea}
{/* <Link to={`/area/${mealArea}`}>
See every {mealArea} recipes
</Link> */}
</li>
</ul>
</div>

View file

@ -1,9 +1,9 @@
import React, { useEffect } from "react";
import CategoryEntry from "../components/CategoryEntry";
export const CategoryListPage = props => {
const { categories } = props.categories;
const { getCategories } = props;
export const CategoryListPage = ({ items, getCategories }) => {
const categories = items.categories;
// const { getCategories } = props;
useEffect(() => {
getCategories();