diff --git a/README.md b/README.md
index c210086..c147cd2 100644
--- a/README.md
+++ b/README.md
@@ -96,9 +96,5 @@ Free meal planner for cooks short on ideas! (like me …)
- send message after contact form validation (confirm to sender and msg+info to admin)
- code cleanup (props and refactoring)
- put a preloader
-- redirect after failed fetch request: (history.push('/path'), or write handleFetchResponse function)
- - https://stackoverflow.com/questions/45089386/what-is-the-best-way-to-redirect-a-page-using-react-router
- - https://www.henriksommerfeld.se/error-handling-with-fetch/
- - Use ErrorBoundaries component ?
- Back to top button
- Take a look at some components [here](http://react-materialize.github.io/react-materialize/?path=/story/css-grid--default)
diff --git a/src/App.js b/src/App.js
index 9cbe96d..c24c7b8 100644
--- a/src/App.js
+++ b/src/App.js
@@ -106,24 +106,33 @@ export const App = () => {
return (
+
+
+
-
+ {meal !== undefined && meal.meals !== null ? (
+
+ ) : (
+
+ )}
+
+
{
meal={meal}
/>
+
+
+
+
-
+ {meal !== undefined && meal.meals !== null ? (
+
+ ) : (
+
+ )}
+
+
);
diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx
index bb5f65c..820e49a 100644
--- a/src/components/Footer.jsx
+++ b/src/components/Footer.jsx
@@ -11,10 +11,10 @@ export const Footer = () => {
-
Links
+
Navigation
{links.map((link, i) => (
-
+
))}
diff --git a/src/components/FooterLink.jsx b/src/components/FooterLink.jsx
index 7200d60..c41b292 100644
--- a/src/components/FooterLink.jsx
+++ b/src/components/FooterLink.jsx
@@ -2,9 +2,9 @@ import React from "react";
import { Link } from "react-router-dom";
import { upFirstChar } from "../utils/methods";
-export const FooterLink = ({ link, i }) => {
+export const FooterLink = ({ link }) => {
return (
-
+
{upFirstChar(link)}
diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx
index 1e0f6b8..58ee4c2 100644
--- a/src/components/Navbar.jsx
+++ b/src/components/Navbar.jsx
@@ -14,7 +14,7 @@ export const Navbar = props => {
{links.map((link, i) => (
-
+
))}
-
{
+export const RandomButton = ({ url, size = "large", handleClick }) => {
const classString = `waves-effect waves-light btn-${size}`;
return (
diff --git a/src/pages/Meal.jsx b/src/pages/Meal.jsx
index d4c4d70..bdad1ef 100644
--- a/src/pages/Meal.jsx
+++ b/src/pages/Meal.jsx
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
import { MealPresentation } from "../components/MealPresentation";
import { IngredientList } from "../components/IngredientList";
import { Recipe } from "../components/Recipe";
-import { useParams, Redirect } from "react-router-dom";
+import { useParams } from "react-router-dom";
export const Meal = props => {
const { getMeal } = props;
@@ -12,50 +12,46 @@ export const Meal = props => {
idMeal === null ? getMeal() : getMeal(idMeal);
}, []);
- if (props.meal.meals !== null) {
- const meal = props.meal.meals[0];
+ const meal = props.meal.meals[0];
- const {
- strMeal,
- strMealThumb,
- strYoutube,
- strCategory,
- strArea,
- strInstructions
- } = meal;
+ const {
+ strMeal,
+ strMealThumb,
+ strYoutube,
+ strCategory,
+ strArea,
+ strInstructions
+ } = meal;
- const item = {
- mealName: strMeal,
- imgAddress: strMealThumb,
- videoAddress: strYoutube,
- mealCategory: strCategory,
- mealArea: strArea
- };
+ const item = {
+ mealName: strMeal,
+ imgAddress: strMealThumb,
+ videoAddress: strYoutube,
+ mealCategory: strCategory,
+ mealArea: strArea
+ };
- let ingredientList = [];
- var i;
- for (i = 1; i <= 20; i++) {
- var strIng = `strIngredient${i}`;
- var strMes = `strMeasure${i}`;
- if (meal[strIng] !== "" && meal[strIng] !== null) {
- ingredientList.push([meal[strIng], meal[strMes]]);
- }
+ let ingredientList = [];
+ var i;
+ for (i = 1; i <= 20; i++) {
+ var strIng = `strIngredient${i}`;
+ var strMes = `strMeasure${i}`;
+ if (meal[strIng] !== "" && meal[strIng] !== null) {
+ ingredientList.push([meal[strIng], meal[strMes]]);
}
-
- return (
-
- );
- } else {
- return ;
}
+
+ return (
+
+ );
};
diff --git a/src/pages/NotFound.jsx b/src/pages/NotFound.jsx
index 098c6c3..a48e5ca 100644
--- a/src/pages/NotFound.jsx
+++ b/src/pages/NotFound.jsx
@@ -3,15 +3,22 @@ import { RandomButton } from "../components/RandomButton";
export const NotFoundPage = props => {
return (
-
-
+
+
Wrong Way!
-

-
-
+
+
+
+

+
+
+
+
+