Skip to content

Commit b6d5a52

Browse files
committed
Fix instruction editing and prepration rendering.
1 parent 77ad34c commit b6d5a52

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

fly/webserver/src/components/EditRecipe.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Recipe, RecipeIngredient as DBRecipeIngredient, User } from '@prisma/client';
22
import { Component, createSignal, createUniqueId, For } from 'solid-js';
3-
import { createStore, produce } from "solid-js/store";
3+
import { createStore, produce, unwrap } from "solid-js/store";
44

55
import { GrowingTextarea } from './GrowingTextarea';
66

@@ -359,7 +359,7 @@ const InstructionsEditor: Component<{ steps: string[] }> = (props) => {
359359
onDrop={onDrop}
360360
>
361361
<GrowingTextarea name={`step.${index()}`} draggable={false}
362-
onInput={e => { setSteps(s => s === step, "step", e.currentTarget.value); }}
362+
onInput={e => setSteps(s => s === unwrap(step), "step", e.currentTarget.value)}
363363
onKeyDown={[onStepKeyDown, step]}>{step.step}</GrowingTextarea>
364364
</li>
365365
}

fly/webserver/src/pages/r/[username]/[slug].astro

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ const user = await getLogin(Astro.cookies);
4343
{
4444
recipe.ingredients.map((ingredient) => (
4545
<li>
46-
{ingredient.amount}{" "}
47-
{ingredient.unit}{" "}
48-
{ingredient.ingredient}
49-
{ingredient.preparation ? `, ${ingredient.preparation}` : null}
46+
{ingredient.amount}
47+
{ingredient.unit}
48+
{ingredient.ingredient +
49+
(ingredient.preparation ? `, ${ingredient.preparation}` : "")}
5050
</li>
5151
))
5252
}

0 commit comments

Comments
 (0)