Make amount for an ingredient optional.
This commit is contained in:
parent
3c9c94957f
commit
0dc2eb2e3c
4 changed files with 122 additions and 96 deletions
|
|
@ -58,7 +58,7 @@ export default function RecipeDetailPage() {
|
|||
...ingGrp,
|
||||
ingredientList: ingGrp.ingredientList.map((ing) => ({
|
||||
...ing,
|
||||
amount: ing.amount * factor,
|
||||
amount: ing.amount !== undefined ? ing.amount * factor : ing.amount,
|
||||
}))
|
||||
}))
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ export default function RecipeDetailPage() {
|
|||
<ul className="default-list">
|
||||
{group.ingredientList.map((ing, j) => (
|
||||
<li key={j}>
|
||||
{ing.amount} {ing.unit ?? ""} {ing.name}
|
||||
{ing.amount ?? ""} {ing.unit ?? ""} {ing.name}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue