-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeal.js
50 lines (46 loc) · 1.03 KB
/
meal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class Meal {
constructor(mealData) {
this.mealData = mealData
}
renderToString() {
const {
strArea,
strCategory,
strIngredient1,
strMeasure1,
strInstructions,
strMeal,
strMealThumb,
strTags,
strYoutube,
} = this.mealData
const embededYoutubeUrl = strYoutube.replace('/watch?v=', '/embed/')
return `
<li class="recipe">
<div>
<img
width="130px"
height="130px"
src=${strMealThumb}
>
</div>
<div class="recipeColumn">
<span>${strArea}</span> <span>${strCategory}</span>
<br />
<span>${strMeal}</span>
<br /><br />
Ingredient List
<ul>
<li>${strIngredient1}: ${strMeasure1}</li>
</ul>
<br />
Instruction
<div class="recipeInstructions">${strInstructions}</div>
<br /><br />
<span>${strTags}</span>
</div>
</li>
`
}
}
export default Meal