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.

Add required badge to name, email, and country

Ian MacCallumfdea11ee6736
diff --git a/apps/web/ui/partners/groups/design/application-form/fields/form-control.tsx b/apps/web/ui/partners/groups/design/application-form/fields/form-control.tsx
index 06dc7970bc..9433fd47ee 100644
--- a/apps/web/ui/partners/groups/design/application-form/fields/form-control.tsx
+++ b/apps/web/ui/partners/groups/design/application-form/fields/form-control.tsx
@@ -8,6 +8,14 @@ export type FormControlProps = PropsWithChildren<{
error?: string;
}>;
+export const FormControlRequiredBadge = () => {
+ return (
+ <span className="min-h-4 rounded-md bg-orange-100 px-1 text-xs font-semibold text-orange-600">
+ Required
+ </span>
+ );
+};
+
export const FormControl = ({
label,
required,
@@ -21,11 +29,7 @@ export const FormControl = ({
<span className="text-content-emphasis text-sm font-medium">
{label}
</span>
- {required && (
- <span className="min-h-4 rounded-md bg-orange-100 px-1 text-xs font-semibold text-orange-600">
- Required
- </span>
- )}
+ {required && <FormControlRequiredBadge />}
</div>
<div className="mt-2">
diff --git a/apps/web/ui/partners/groups/design/application-form/program-application-form.tsx b/apps/web/ui/partners/groups/design/application-form/program-application-form.tsx
index ecfe66d933..17ec396728 100644
--- a/apps/web/ui/partners/groups/design/application-form/program-application-form.tsx
+++ b/apps/web/ui/partners/groups/design/application-form/program-application-form.tsx
@@ -29,6 +29,7 @@ import { Controller, FormProvider, useForm } from "react-hook-form";
import { toast } from "sonner";
import { CountryCombobox } from "../../../country-combobox";
import { ProgramApplicationFormField } from "./fields";
+import { FormControlRequiredBadge } from "./fields/form-control";
type FormData = {
name: string;
@@ -195,7 +196,12 @@ export function ProgramApplicationForm({
className="flex flex-col gap-6"
>
<label>
- <span className="text-sm font-medium text-neutral-800">Name</span>
+ <div className="flex items-center gap-1.5">
+ <span className="text-content-emphasis text-sm font-medium">
+ Name
+ </span>
+ <FormControlRequiredBadge />
+ </div>
<input
type="text"
autoComplete="name"
@@ -214,7 +220,12 @@ export function ProgramApplicationForm({
</label>
<label>
- <span className="text-sm font-medium text-neutral-800">Email</span>
+ <div className="flex items-center gap-1.5">
+ <span className="text-content-emphasis text-sm font-medium">
+ Email
+ </span>
+ <FormControlRequiredBadge />
+ </div>
<input
type="email"
autoComplete="email"
@@ -232,7 +243,13 @@ export function ProgramApplicationForm({
</label>
<label className="flex flex-col">
- <span className="text-sm font-medium text-neutral-800">Country</span>
+ <div className="flex items-center gap-1.5">
+ <span className="text-content-emphasis text-sm font-medium">
+ Country
+ </span>
+ <FormControlRequiredBadge />
+ </div>
+
<Controller
control={control}
name="country"