added restaurant, tag, and comments to reviewDetails

Co-authored-by: rheabhutada02
This commit is contained in:
d7hernan 2022-11-20 22:22:31 -08:00
parent 6d126f6085
commit 9ef3c59fee
2 changed files with 9 additions and 8 deletions

View File

@ -25,7 +25,7 @@
<!--- meal --> <!--- meal -->
<div class = "meal-name"> <div class = "meal-name">
<h1 id="d-mealName"> Cucumber Salad </h1> <h1 id="d-mealName"> default meal name </h1>
</div> </div>
<div class = "meal-pics-and-tags"> <div class = "meal-pics-and-tags">
@ -33,14 +33,15 @@
<img src = https://images.pexels.com/photos/1640777/pexels-photo-1640777.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1, <img src = https://images.pexels.com/photos/1640777/pexels-photo-1640777.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1,
alt = "photo" width=40% height=40% id="d-mealImg"> alt = "photo" width=40% height=40% id="d-mealImg">
<h2 id="d-restaurant"> default comment </h2>
<div class = "tag-container", id="d-tags"> <div class = "tag-container", id="d-tags">
</div> </div>
</div> </div>
<div class = "stars-and-comments"> <div class = "stars-and-comments">
<img src = "./assets/images/icons/5-star.svg" width=10% height=10% id="d-rating"> <img src = "./assets/images/icons/5-star.svg" width=10% height=10% id="d-rating">
<h2> The food was good </h2> <h2 id="d-comments"> default comment </h2>
</div> </div>
<main> <main>

View File

@ -29,18 +29,18 @@ function setupInfo(){
mealLabel.innerHTML = currReview["mealName"]; mealLabel.innerHTML = currReview["mealName"];
//restaurant name //restaurant name
/*let restaurantLabel = document.getElementById("d-restaurant"); let restaurantLabel = document.getElementById("d-restaurant");
restaurantLabel.innerHTML = currReview["restaurant"]; restaurantLabel.innerHTML = currReview["restaurant"];
//comments //comments
let comments = document.getElementById("d-comments"); let comments = document.getElementById("d-comments");
comments.innerText = currReview["comments"]; comments.innerText = currReview["comments"];
*/
//rating //rating
let starsImg = document.getElementById("d-rating"); let starsImg = document.getElementById("d-rating");
starsImg.setAttribute("src", "./assets/images/icons/"+currReview["rating"]+"-star.svg"); starsImg.setAttribute("src", "./assets/images/icons/"+currReview["rating"]+"-star.svg");
starsImg.setAttribute("alt", currReview["rating"] +" stars"); starsImg.setAttribute("alt", currReview["rating"] +" stars");
/*
//tags //tags
let tagContainer = document.getElementById("d-tags"); let tagContainer = document.getElementById("d-tags");
if(currReview["tags"]){ if(currReview["tags"]){
@ -50,7 +50,7 @@ function setupInfo(){
newTag.innerHTML = currReview["tags"][i]; newTag.innerHTML = currReview["tags"][i];
tagContainer.append(newTag); tagContainer.append(newTag);
} }
}*/ }
} }
function setupDelete(){ function setupDelete(){