mirror of
https://github.com/rjNemo/meal_planner
synced 2026-06-10 20:36:39 +00:00
cleanup
This commit is contained in:
parent
4c8ffd52f3
commit
bce9407986
5 changed files with 12 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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/">
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue