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.

fix form

Kiran K4465a0cf06e0
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/settings/program-settings.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/settings/program-settings.tsx
index 81a3c18a66..3e14e9ae78 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/settings/program-settings.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/settings/program-settings.tsx
@@ -273,7 +273,7 @@ function ProgramSettingsForm({ program }: { program: ProgramProps }) {
<div className="flex flex-col gap-6">
<div>
<label
- htmlFor="duration"
+ htmlFor="commissionType"
className="text-sm font-medium text-neutral-800"
>
Payout model
@@ -291,7 +291,7 @@ function ProgramSettingsForm({ program }: { program: ProgramProps }) {
<div>
<label
- htmlFor="duration"
+ htmlFor="amount"
className="text-sm font-medium text-neutral-800"
>
Amount
diff --git a/apps/web/ui/partners/create-payout-sheet.tsx b/apps/web/ui/partners/create-payout-sheet.tsx
index 04b1c51d7b..a54e3ea3eb 100644
--- a/apps/web/ui/partners/create-payout-sheet.tsx
+++ b/apps/web/ui/partners/create-payout-sheet.tsx
@@ -54,7 +54,6 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
defaultValues: {
type: "sales",
},
- // resolver: zodResolver(schema),
});
const partnerId = watch("partnerId");
@@ -103,14 +102,11 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
);
},
onError({ error }) {
- console.log("error", error);
toast.error(error.serverError);
},
});
const onSubmit = async (data: FormData) => {
- console.log("data", data);
-
if (workspaceId && program) {
await executeAsync({
...data,
@@ -122,8 +118,6 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
}
};
- const isValid = Object.keys(errors).length === 0;
-
return (
<form onSubmit={handleSubmit(onSubmit)} className="flex h-full flex-col">
<div>
@@ -212,24 +206,34 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
</div>
{payoutType !== "sales" && (
- <div className="flex flex-col gap-2">
+ <div>
<label
htmlFor="amount"
- className="flex items-center space-x-2 text-sm font-medium text-gray-900"
+ className="text-sm font-medium text-neutral-800"
>
Amount
</label>
- <div className="relative rounded-md shadow-sm">
+ <div className="relative mt-2 rounded-md shadow-sm">
+ <span className="absolute inset-y-0 left-0 flex items-center pl-3 text-sm text-neutral-400">
+ $
+ </span>
<input
+ className={cn(
+ "block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",
+ "pl-6 pr-12",
+ )}
{...register("amount", {
required: true,
- setValueAs: (value) => Number(value) || "",
+ valueAsNumber: true,
+ min: 0,
})}
- className="block w-full rounded-md border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
- placeholder="500"
type="number"
autoComplete="off"
+ placeholder="100"
/>
+ <span className="absolute inset-y-0 right-0 flex items-center pr-3 text-sm text-neutral-400">
+ USD
+ </span>
</div>
</div>
)}