add servings information to recipe
This commit is contained in:
parent
5c8ddf96f2
commit
fee47da55d
7 changed files with 71 additions and 8 deletions
|
|
@ -34,7 +34,32 @@ export default function RecipeEditor({ recipe, onSave, onCancel }: RecipeEditorP
|
|||
value={draft.title}
|
||||
onChange={e => setDraft({ ...draft, title: e.target.value })}
|
||||
/>
|
||||
|
||||
{/* Servings */}
|
||||
<h3 className="subsection-heading">Servings</h3>
|
||||
<div className="columns-3 gap-2 flex items-center">
|
||||
<label>For</label>
|
||||
<input
|
||||
type="number"
|
||||
className="input-field w-20"
|
||||
placeholder="1"
|
||||
value={draft.servings.amount}
|
||||
onChange={e => {
|
||||
let tempServings = draft.servings
|
||||
tempServings.amount = Number(e.target.value)
|
||||
setDraft({...draft, servings: tempServings})
|
||||
}}
|
||||
/>
|
||||
<input
|
||||
className="input-field"
|
||||
placeholder="Persons"
|
||||
value={draft.servings.unit}
|
||||
onChange={e => {
|
||||
let tempServings = draft.servings
|
||||
tempServings.unit = e.target.value
|
||||
setDraft({...draft, servings: tempServings})
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{/* Ingredient List */}
|
||||
<IngredientListEditor
|
||||
ingredients={draft.ingredients}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue