diff --git a/src/components/pages/Bookmark.jsx b/src/components/pages/Bookmark.jsx index a55847e..adb6e29 100644 --- a/src/components/pages/Bookmark.jsx +++ b/src/components/pages/Bookmark.jsx @@ -1,9 +1,38 @@ -function Bookmark() { - return
-

Bookmark

+let numberOfBookmarks = 10; // TODO: this is a hardcoded value. Should fetched from database? +const recipes = []; -
; +fetch("https://htv7-96f00-default-rtdb.firebaseio.com/recipe.json") + .then((response) => { + return response.json(); + }) + .then((data) => { + + for (const key in data) { + const recipe = { + id: key, + ...data[key], + }; + recipes.push(recipe); + } + }); + +function Bookmark() { + let recipeList = []; + for (let i = 0; i < recipes.length; i++) { + recipeList.push( +
+ {/* //? image of recipe */} +
+

{recipes[i].name}

{/* //? name of recipe */} +

{recipes[i].discription}

{/* //? small discription of the recipe */} +
+
+ ); } - - export default Bookmark; - \ No newline at end of file + return
+

Bookmark recipes

+ {recipeList} +
; +} + +export default Bookmark; \ No newline at end of file