From 12fdc42bd53631a3ac1163bbe3253735d8ed1f34 Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Fri, 31 Jan 2020 08:24:30 +0100 Subject: [PATCH] navigation error handling --- README.md | 4 -- src/App.js | 23 +++++++++- src/components/Footer.jsx | 4 +- src/components/FooterLink.jsx | 4 +- src/components/Navbar.jsx | 2 +- src/components/RandomButton.jsx | 2 +- src/pages/Meal.jsx | 80 ++++++++++++++++----------------- src/pages/NotFound.jsx | 23 ++++++---- 8 files changed, 80 insertions(+), 62 deletions(-) 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 ? ( + + ) : ( + + )} + +