diff --git a/app/sign-up-form.tsx b/app/sign-up-form.tsx index ca0a5b8..c84f1d8 100644 --- a/app/sign-up-form.tsx +++ b/app/sign-up-form.tsx @@ -41,7 +41,7 @@ export default function SignUp() { // Double-check signup isn't blocked before submitting const currentStatus = isSignupBlocked(); if (currentStatus.blocked) { - setResponse(currentStatus.message || "Sign-ups are currently closed."); + setResponse(currentStatus.message ?? "Sign-ups are currently closed."); return; } setSubmitted(true); diff --git a/components/ui/form.tsx b/components/ui/form.tsx index 4a32ae2..84e0f21 100644 --- a/components/ui/form.tsx +++ b/components/ui/form.tsx @@ -3,26 +3,19 @@ import * as React from "react"; import * as LabelPrimitive from "@radix-ui/react-label"; import { Slot } from "@radix-ui/react-slot"; -import { - Controller, - ControllerProps, - FieldPath, - FieldValues, - FormProvider, - useFormContext, -} from "react-hook-form"; +import { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext } from "react-hook-form"; import { cn } from "@/lib/utils"; import { Label } from "@/components/ui/label"; const Form = FormProvider; -type FormFieldContextValue< +interface FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, TName extends FieldPath = FieldPath -> = { +> { name: TName; -}; +} const FormFieldContext = React.createContext({} as FormFieldContextValue); @@ -62,9 +55,9 @@ const useFormField = () => { }; }; -type FormItemContextValue = { +interface FormItemContextValue { id: string; -}; +} const FormItemContext = React.createContext({} as FormItemContextValue); @@ -87,83 +80,52 @@ const FormLabel = React.forwardRef< >(({ className, ...props }, ref) => { const { error, formItemId } = useFormField(); - return ( -