From 0802e367968d467348a3438d3f27eedfa057d895 Mon Sep 17 00:00:00 2001 From: Ryan Pandya Date: Mon, 18 Nov 2024 10:04:25 -0800 Subject: [PATCH] Small changes to label form --- apps/web/auth_failures.log | 3 + .../dashboard/labels/AddLabelDialog.tsx | 125 +++++++++--------- ....tsx => DeleteLabelConfirmationDialog.tsx} | 22 +-- .../dashboard/labels/LabelsView.tsx | 18 +++ packages/db/drizzle.ts | 6 +- packages/shared-react/hooks/labels.ts | 50 +++++++ packages/shared-react/hooks/tags.ts | 69 ---------- packages/trpc/routers/labels.ts | 30 ++++- 8 files changed, 173 insertions(+), 150 deletions(-) rename apps/web/components/dashboard/labels/{DeleteTagConfirmationDialog.tsx => DeleteLabelConfirmationDialog.tsx} (64%) create mode 100644 packages/shared-react/hooks/labels.ts delete mode 100644 packages/shared-react/hooks/tags.ts diff --git a/apps/web/auth_failures.log b/apps/web/auth_failures.log index e69de29..514f8e7 100644 --- a/apps/web/auth_failures.log +++ b/apps/web/auth_failures.log @@ -0,0 +1,3 @@ +2024-11-18T16:54:25.722Z error: Authentication error. User: "ryan@pandu.ski", Message: "no such table: user", IP-Address: "::ffff:127.0.0.1" +2024-11-18T16:54:31.817Z error: Authentication error. User: "ryan@ryanpandya.com", Message: "no such table: user", IP-Address: "::ffff:127.0.0.1" +2024-11-18T16:54:43.805Z error: Authentication error. User: "ryan@ryanpandya.com", Message: "no such table: user", IP-Address: "::ffff:127.0.0.1" diff --git a/apps/web/components/dashboard/labels/AddLabelDialog.tsx b/apps/web/components/dashboard/labels/AddLabelDialog.tsx index 6fd021c..37297b6 100644 --- a/apps/web/components/dashboard/labels/AddLabelDialog.tsx +++ b/apps/web/components/dashboard/labels/AddLabelDialog.tsx @@ -34,6 +34,7 @@ import { useForm } from "react-hook-form"; import { z } from "zod"; import { zLabelSchema } from "@lifetracker/shared/types/labels"; +import { Textarea } from "@/components/ui/textarea"; type CreateLabelSchema = z.infer; @@ -46,13 +47,6 @@ export default function AddLabelDialog({ const [isOpen, onOpenChange] = useState(false); const form = useForm({ resolver: zodResolver(zLabelSchema), - defaultValues: { - id: "69", - name: "Fuckdicks", - code: 420, - description: "This shit sucks", - color: "#004400", - }, }); const { mutate, isPending } = api.labels.createLabel.useMutation({ onSuccess: () => { @@ -87,56 +81,75 @@ export default function AddLabelDialog({ {children} - Add User + Create Label
mutate(val))}>
- ( - - Name - - - - - - )} - /> - ( - - Code - - - - - - )} - /> +
+ ( + + {/* Code */} + + + + + + )} + /> + ( + + {/* Name */} + + + + + + )} + /> + ( + + {/* Color */} + + + + + + )} + /> +
( - Description + {/* Description */} - )} /> - ( - - Color, hope you like hex codes - - - - - - )} - />