Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ function PayoutSettingsModalInner({
await executeAsync(data);
};

const shouldDisableSubmit = useMemo(() => {
return !watch("companyName") || !isDirty;
}, [watch, isDirty]);

const minWithdrawalAmount = watch("minWithdrawalAmount");

const scrollRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -182,10 +178,9 @@ function PayoutSettingsModalInner({
</label>
<div className="relative mt-1.5 rounded-md shadow-sm">
<input
required
autoFocus
className="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"
{...register("companyName", { required: true })}
{...register("companyName")}
/>
</div>
</div>
Expand Down Expand Up @@ -233,7 +228,7 @@ function PayoutSettingsModalInner({
text="Save"
className="h-8 w-fit px-3"
loading={isPending}
disabled={shouldDisableSubmit}
disabled={!isDirty}
type="submit"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/zod/schemas/partners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ export const archivePartnerSchema = z.object({
});

export const partnerPayoutSettingsSchema = z.object({
companyName: z.string().max(190).trim().min(1, "Business name is required."),
companyName: z.string().max(190).trim().nullish(),
address: z.string().max(500).trim().nullish(),
taxId: z.string().max(100).trim().nullish(),
minWithdrawalAmount: z.coerce
Expand Down