Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Move the lead form field type icons out of the builder helpers

Rafi42369be97036
diff --git a/apps/web/ui/submitted-leads/form-builder/lead-form-builder-fields.ts b/apps/web/ui/submitted-leads/form-builder/lead-form-builder-fields.ts
index baef277593..58479f534a 100644
--- a/apps/web/ui/submitted-leads/form-builder/lead-form-builder-fields.ts
+++ b/apps/web/ui/submitted-leads/form-builder/lead-form-builder-fields.ts
@@ -1,16 +1,4 @@
import { formFieldSchema } from "@/lib/zod/schemas/submitted-lead-form";
-import {
- CalendarIcon,
- CheckboxChecked,
- DropdownSelect,
- Globe,
- Hashtag,
- Icon,
- InputField,
- LinkChain,
- MobilePhone,
- TextArea,
-} from "@dub/ui/icons";
import { nanoid } from "@dub/utils";
import * as z from "zod/v4";
@@ -18,26 +6,6 @@ type FormField = z.infer<typeof formFieldSchema>;
export type LeadFormFieldType = FormField["type"];
-export const LEAD_FORM_FIELD_TYPES: Record<
- LeadFormFieldType,
- {
- label: string;
- icon: Icon;
- // Hidden types are only shown for existing fields that already use them
- hidden?: boolean;
- }
-> = {
- text: { label: "Text field", icon: InputField },
- textarea: { label: "Text area", icon: TextArea },
- date: { label: "Date selection", icon: CalendarIcon },
- url: { label: "URL", icon: LinkChain },
- select: { label: "Dropdown", icon: DropdownSelect },
- country: { label: "Country", icon: Globe },
- multiSelect: { label: "Multiple choice", icon: CheckboxChecked },
- number: { label: "Number", icon: Hashtag },
- phone: { label: "Phone number", icon: MobilePhone, hidden: true },
-};
-
export type LeadFormBuilderOption = {
value: string;
label: string;
diff --git a/apps/web/ui/submitted-leads/form-builder/lead-form-field-card.tsx b/apps/web/ui/submitted-leads/form-builder/lead-form-field-card.tsx
index e416d5c5fc..1636312ce4 100644
--- a/apps/web/ui/submitted-leads/form-builder/lead-form-field-card.tsx
+++ b/apps/web/ui/submitted-leads/form-builder/lead-form-field-card.tsx
@@ -13,11 +13,11 @@ import { PointerEvent, ReactNode } from "react";
import {
changeLeadFormBuilderFieldType,
createLeadFormBuilderOption,
- LEAD_FORM_FIELD_TYPES,
LeadFormBuilderField,
LeadFormBuilderOption,
LeadFormFieldType,
} from "./lead-form-builder-fields";
+import { LEAD_FORM_FIELD_TYPES } from "./lead-form-field-types";
// Prevent the default action so the browser doesn't select text while dragging
function startDrag(
diff --git a/apps/web/ui/submitted-leads/form-builder/lead-form-field-types.ts b/apps/web/ui/submitted-leads/form-builder/lead-form-field-types.ts
new file mode 100644
index 0000000000..b6bb85e902
--- /dev/null
+++ b/apps/web/ui/submitted-leads/form-builder/lead-form-field-types.ts
@@ -0,0 +1,33 @@
+import {
+ CalendarIcon,
+ CheckboxChecked,
+ DropdownSelect,
+ Globe,
+ Hashtag,
+ Icon,
+ InputField,
+ LinkChain,
+ MobilePhone,
+ TextArea,
+} from "@dub/ui/icons";
+import { LeadFormFieldType } from "./lead-form-builder-fields";
+
+export const LEAD_FORM_FIELD_TYPES: Record<
+ LeadFormFieldType,
+ {
+ label: string;
+ icon: Icon;
+ // Hidden types are only shown for existing fields that already use them
+ hidden?: boolean;
+ }
+> = {
+ text: { label: "Text field", icon: InputField },
+ textarea: { label: "Text area", icon: TextArea },
+ date: { label: "Date selection", icon: CalendarIcon },
+ url: { label: "URL", icon: LinkChain },
+ select: { label: "Dropdown", icon: DropdownSelect },
+ country: { label: "Country", icon: Globe },
+ multiSelect: { label: "Multiple choice", icon: CheckboxChecked },
+ number: { label: "Number", icon: Hashtag },
+ phone: { label: "Phone number", icon: MobilePhone, hidden: true },
+};