diff --git a/apps/infoalloggi/Dockerfile b/apps/infoalloggi/Dockerfile index 8de39a5..81414cc 100644 --- a/apps/infoalloggi/Dockerfile +++ b/apps/infoalloggi/Dockerfile @@ -14,7 +14,7 @@ FROM base AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . - +ENV NODE_ENV=production ARG BASE_URL ENV NEXT_PUBLIC_BASE_URL=$BASE_URL ARG INTERNAL_BASE_URL diff --git a/apps/infoalloggi/src/components/custom_ui/form.tsx b/apps/infoalloggi/src/components/custom_ui/form.tsx index 125c50a..978936f 100644 --- a/apps/infoalloggi/src/components/custom_ui/form.tsx +++ b/apps/infoalloggi/src/components/custom_ui/form.tsx @@ -12,8 +12,6 @@ import { import { cn } from "src/lib/utils"; import { Label } from "src/components/ui/label"; -import dynamic from "next/dynamic"; -import { env } from "~/env.mjs"; const Form = FormProvider; @@ -173,25 +171,6 @@ const FormMessage = React.forwardRef< }); FormMessage.displayName = "FormMessage"; -const FormDebug = React.forwardRef< - React.ElementType, - React.HTMLAttributes ->(() => { - if (env.NODE_ENV !== "development") { - return null; - } - const { control, formState } = useFormContext(); - const DevT: React.ElementType = dynamic( - () => import("@hookform/devtools").then((module) => module.DevTool), - { ssr: false }, - ); - if (Object.keys(formState.errors).length > 0) { - console.error("errors", formState.errors); - } - return ; -}); -FormDebug.displayName = "FormDebug"; - export { useFormField, Form, @@ -201,5 +180,4 @@ export { FormDescription, FormMessage, FormField, - FormDebug, }; diff --git a/apps/infoalloggi/src/components/custom_ui/formDevTool.tsx b/apps/infoalloggi/src/components/custom_ui/formDevTool.tsx new file mode 100644 index 0000000..86b2d56 --- /dev/null +++ b/apps/infoalloggi/src/components/custom_ui/formDevTool.tsx @@ -0,0 +1,7 @@ +import dynamic from "next/dynamic"; +import type React from "react"; + +export const DevT: React.ElementType = dynamic( + () => import("@hookform/devtools").then((mod) => mod.DevTool), + { ssr: false }, +);