Chef's Categories
diff --git a/src/pages/CategoryPage.jsx b/src/pages/CategoryPage.jsx
new file mode 100644
index 0000000..81c76f4
--- /dev/null
+++ b/src/pages/CategoryPage.jsx
@@ -0,0 +1,32 @@
+import React from "react";
+import { Link } from "react-router-dom";
+
+export const CategoryPage = ({ meals, strCategory }) => {
+ return (
+
+
Chef's {strCategory} Recipes
+
+ }
+
+ );
+};
diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx
deleted file mode 100644
index b17c576..0000000
--- a/src/pages/Home.jsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import React from "react";
-import { RandomButton } from "../components/RandomButton";
-
-export const Home = ({ buttonUrl }) => {
- return (
-
-
-
-
-
Chef's Online Cookbook
-
-
-
-
})
-
-
-
-
- );
-};
diff --git a/src/pages/HomePage.jsx b/src/pages/HomePage.jsx
new file mode 100644
index 0000000..06049d1
--- /dev/null
+++ b/src/pages/HomePage.jsx
@@ -0,0 +1,22 @@
+import React from "react";
+import { RandomButton } from "../components/RandomButton";
+
+export const HomePage = ({ buttonUrl }) => {
+ return (
+
+
+
+
Chef's Online Cookbook
+
+
+
+
})
+
+
+
+ );
+};
diff --git a/src/pages/Meal.jsx b/src/pages/Meal.jsx
deleted file mode 100644
index 7f86e97..0000000
--- a/src/pages/Meal.jsx
+++ /dev/null
@@ -1,58 +0,0 @@
-import React, { useEffect } from "react";
-import { MealPresentation } from "../components/MealPresentation";
-import { IngredientList } from "../components/IngredientList";
-import { Recipe } from "../components/Recipe";
-import { useParams } from "react-router-dom";
-
-export const Meal = props => {
- const { getMeal } = props;
- const { idMeal } = useParams();
-
- useEffect(() => {
- idMeal === null ? getMeal() : getMeal(idMeal);
- // eslint-disable-next-line
- }, []);
-
- const meal = props.meal.meals[0];
-
- const {
- strMeal,
- strMealThumb,
- strYoutube,
- strCategory,
- strArea,
- strInstructions
- } = meal;
-
- 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]]);
- }
- }
-
- return (
-
- );
-};
diff --git a/src/pages/MealPage.jsx b/src/pages/MealPage.jsx
new file mode 100644
index 0000000..7de0d9a
--- /dev/null
+++ b/src/pages/MealPage.jsx
@@ -0,0 +1,20 @@
+import React from "react";
+import { MealPresentation } from "../components/MealPresentation";
+import { IngredientList } from "../components/IngredientList";
+import { Recipe } from "../components/Recipe";
+
+export const MealPage = ({ item, ingredientList, strInstructions }) => {
+ return (
+
+ );
+};
diff --git a/src/pages/NotFound.jsx b/src/pages/NotFoundPage.jsx
similarity index 94%
rename from src/pages/NotFound.jsx
rename to src/pages/NotFoundPage.jsx
index a48e5ca..a021208 100644
--- a/src/pages/NotFound.jsx
+++ b/src/pages/NotFoundPage.jsx
@@ -1,7 +1,7 @@
import React from "react";
import { RandomButton } from "../components/RandomButton";
-export const NotFoundPage = props => {
+export const NotFoundPage = () => {
return (
diff --git a/src/pages/Profile.jsx b/src/pages/ProfilePage.jsx
similarity index 60%
rename from src/pages/Profile.jsx
rename to src/pages/ProfilePage.jsx
index 40f6781..b5c3986 100644
--- a/src/pages/Profile.jsx
+++ b/src/pages/ProfilePage.jsx
@@ -1,15 +1,7 @@
import React from "react";
-import { useAuth0 } from "../utils/auth0-spa";
-import { PreLoader } from "../components/PreLoader";
-export const Profile = () => {
- const { loading, user } = useAuth0();
-
- return loading || !user ? ( // is catched by PrivateRoute
-
- ) : (
+export const ProfilePage = ({ user }) => {
+ return (
![]()
{
- let { meals } = props.searchResults;
- const { searchString } = props;
- if (meals === null) {
- meals = [];
- }
-
+export const SearchPage = ({ searchString, searchResults }) => {
+ const { meals } = searchResults;
return (
Results for: {searchString}
- {meals[0] === undefined ? (
+ {meals === null ? (
No results to display, instead there is a picture of my breakfast.
@@ -24,11 +19,13 @@ export const SearchPage = props => {
) : (
-
- {meals.map((meal, i) => (
-
- ))}
-
+
+
+ {meals.map((meal, i) => (
+
+ ))}
+
+
)}
);