diff --git a/src/components/admin/resources/form.tsx b/src/components/admin/resources/form.tsx index cc24ff9..9043c17 100644 --- a/src/components/admin/resources/form.tsx +++ b/src/components/admin/resources/form.tsx @@ -41,6 +41,7 @@ import Modal from "react-modal"; import { type RouterInputs } from "~/utils/api"; import { PlatformLinkButton } from "~/pages/resources/[id]"; import { ResourcePhoto } from "~/components/ResourcePhoto"; +import { FieldLabel } from "~/components/forms/inputLabel"; // Required for accessibility // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access @@ -379,6 +380,33 @@ function ResourceSummarySubForm({ + +
+ +
+ + - + +
+
+ { + return ( +
+ + + {subheading} + +
+ ); +}; diff --git a/src/components/forms/selectors.tsx b/src/components/forms/selectors.tsx index 59a3082..ff8a34d 100644 --- a/src/components/forms/selectors.tsx +++ b/src/components/forms/selectors.tsx @@ -4,6 +4,7 @@ import { useFormContext, type UseFormRegisterReturn, } from "react-hook-form"; +import { FieldLabel } from "./inputLabel"; // generics interface ToStringable { @@ -60,10 +61,7 @@ function MultiSelectorMany({
- - - Select all that apply - +
{children} @@ -100,10 +98,7 @@ function MultiSelector({ >
- - - Select one from below - +
{children}
diff --git a/src/components/forms/textInput.tsx b/src/components/forms/textInput.tsx index 4c3384e..f479d36 100644 --- a/src/components/forms/textInput.tsx +++ b/src/components/forms/textInput.tsx @@ -50,16 +50,18 @@ function GenericInput({ type = "text", details, }: { - label: string; + label?: string; placeholder?: string; type: HTMLInputTypeAttribute; details: UseFormRegisterReturn; }) { return (
- + {label ? ( + + ) : undefined} { + return ages.min < ages.max; + }, + { + message: "Minimum supported age must be less than maximum supported age.", + } + ), skills: z.array(z.nativeEnum(Skill)), skill_levels: z.array(z.nativeEnum(SkillLevel)), payment_options: z.array(z.nativeEnum(PaymentType)),