From 1c56730ed7e85e3e2eba6ba69741d73d3876decb Mon Sep 17 00:00:00 2001 From: George Gebbett Date: Fri, 19 Apr 2024 15:22:13 +0100 Subject: [PATCH] Allow editing recipe title (#485) --- .../(dashboard)/recipes/[id]/recipeForm.tsx | 20 +++++++++++-------- src/components/recipe-title-input.tsx | 15 ++++++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 src/components/recipe-title-input.tsx diff --git a/src/app/(dashboard)/recipes/[id]/recipeForm.tsx b/src/app/(dashboard)/recipes/[id]/recipeForm.tsx index 7fb7e28..ef1db0b 100644 --- a/src/app/(dashboard)/recipes/[id]/recipeForm.tsx +++ b/src/app/(dashboard)/recipes/[id]/recipeForm.tsx @@ -9,12 +9,12 @@ import { } from "~/server/api/modules/grocy/procedures/createRecipeInGrocySchema" import { api } from "~/trpc/react" import { RouterOutputs } from "~/trpc/shared" -import { FormProvider, useForm } from "react-hook-form" +import { Controller, FormProvider, useForm } from "react-hook-form" import { toast } from "sonner" import { Button } from "~/components/ui/button" -import { DashboardHeader } from "~/components/header" import { IngredientTable } from "~/components/ingredient-table" +import { RecipeTitleInput } from "~/components/recipe-title-input" type RecipeFormProps = { recipeId: number @@ -73,18 +73,22 @@ function RecipeFormInner({
- +
+ ( + + )} + name="recipeName" + control={form.control} + /> View Original - +